/* ============================================================
   SerwisApp — Design System (wzorowany na Claude Design)
   app/assets/stylesheets/serwis_design.css
   ============================================================ */

/* ---- Design Tokens ---- */
:root {
  --bg:        #eef0f4;
  --surface:   #ffffff;
  --surface-2: #f7f8fa;
  --border:    #e6e8ee;
  --border-2:  #eceef3;

  --ink:       #1f2430;
  --ink-2:     #515a6b;
  --ink-3:     #8a93a6;

  --blue:      #2f6bf6;
  --blue-ink:  #1f53d6;
  --violet:    #8b5cf6;
  --grad:      linear-gradient(95deg, #3b75f7 0%, #7c5cf6 100%);
  --grad-hover:linear-gradient(95deg, #2f64ef 0%, #6f49f2 100%);

  --green:     #10a36a;
  --green-bg:  #e7f7ef;
  --amber:     #e08a00;
  --amber-bg:  #fdf2dc;
  --orange:    #e8730c;
  --orange-bg: #fdeada;
  --red:       #e0453b;
  --red-bg:    #fdebe9;
  --slate:     #5b6478;
  --slate-bg:  #eef0f4;
  --cyan:      #0c8fb0;
  --cyan-bg:   #e0f4f9;
  --yellow-row:#fffbeb;
  --yellow-row-bd:#f6e7b0;

  --r-sm: 7px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --sh-sm: 0 1px 2px rgba(22,28,45,.06);
  --sh:    0 2px 8px rgba(22,28,45,.07);
  --sh-md: 0 6px 22px rgba(22,28,45,.10);
  --sh-lg: 0 18px 50px rgba(22,28,45,.22);

  --font: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #cfd4de; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6bdcb; background-clip: content-box; }

/* ============================================================
   LAYOUT
   ============================================================ */

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- Header ---- */
.hdr { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.hdr-top { display: flex; align-items: center; gap: 18px; padding: 0 26px; height: 60px; }
.brand { display: flex; align-items: center; gap: 14px; }
.eps-logo { display: flex; align-items: center; gap: 9px; }
.eps-mark {
  width: 44px; height: 30px; background: #1d2330; color: #fff;
  border-radius: 5px; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; letter-spacing: .5px; position: relative;
}
.eps-mark::after {
  content: "SYSTEM"; position: absolute; bottom: -11px;
  font-size: 6.5px; letter-spacing: 2px; color: var(--ink-3); font-weight: 700;
}
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.brand-name .accent { color: var(--blue); }
.brand-divider { width: 1px; height: 28px; background: var(--border); }
.hdr-spacer { flex: 1; }
.hdr-user { display: flex; align-items: center; gap: 16px; }
.user-block { text-align: right; line-height: 1.15; }
.user-name { font-weight: 700; font-size: 13.5px; }
.user-role { font-size: 11px; color: var(--ink-3); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--grad); color: #fff; display: grid;
  place-items: center; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-xs { width: 22px; height: 22px; font-size: 9px; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 9px;
  border: none; background: transparent; color: var(--ink-2);
  display: grid; place-items: center; font-size: 18px;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-badge {
  position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid #fff;
}
.logout { color: var(--ink-2); font-size: 13px; background: none; border: none; padding: 7px 10px; border-radius: 8px; }
.logout:hover { background: var(--surface-2); color: var(--ink); }

/* ---- Module nav ---- */
.modnav {
  display: flex; align-items: center; gap: 4px; padding: 0 22px;
  height: 50px; border-top: 1px solid var(--border-2);
  background: var(--surface); overflow-x: auto;
}
.modnav-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 15px;
  border-radius: 9px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-2); border: none; background: transparent; white-space: nowrap;
}
.modnav-item .mi { font-size: 16px; opacity: .85; }
.modnav-item:hover { background: var(--surface-2); color: var(--ink); }
.modnav-item.active { background: #eef3fe; color: var(--blue-ink); }
.modnav-item .pill {
  background: var(--slate-bg); color: var(--ink-2);
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 9px;
}
.modnav-item.active .pill { background: var(--blue); color: #fff; }

/* ---- Page frame ---- */
.page { flex: 1; padding: 20px 26px 40px; max-width: 1840px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
.page-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.page-sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; }

/* ============================================================
   STATUS TABS (pill group)
   ============================================================ */
.statustabs { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.stab {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  border-radius: 11px; background: transparent; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.stab:hover { background: var(--surface); box-shadow: var(--sh-sm); }
.stab.active { background: var(--surface); box-shadow: var(--sh); color: var(--ink); border-color: var(--border); }
.stab .se { font-size: 15px; }
.stab .cnt { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 9px; }
.stab-group {
  display: flex; align-items: center; gap: 4px; padding: 4px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2);
}
.stab-group .gl {
  font-size: 10px; font-weight: 800; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .6px; padding: 0 8px 0 6px;
}

/* ---- Count badge colors ---- */
.cnt.c-slate  { background: var(--slate-bg);  color: var(--ink-2); }
.cnt.c-blue   { background: #e4ecfe;          color: var(--blue-ink); }
.cnt.c-green  { background: var(--green-bg);  color: var(--green); }
.cnt.c-amber  { background: var(--amber-bg);  color: var(--amber); }
.cnt.c-orange { background: var(--orange-bg); color: var(--orange); }
.cnt.c-violet { background: #ede7fe;          color: #6d3fe0; }
.cnt.c-red    { background: var(--red-bg);    color: var(--red); }
.cnt.c-cyan   { background: var(--cyan-bg);   color: var(--cyan); }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filterbar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 13px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  box-shadow: var(--sh-sm); margin-bottom: 14px;
}
.fb-label { font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .6px; }
.fb-group { display: flex; align-items: center; gap: 8px; }
.fb-spacer { flex: 1; }
.fb-count { font-size: 13px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); padding: 8px 14px; border-radius: 10px; }
.seg { display: flex; gap: 6px; }
.seg button {
  padding: 7px 13px; border-radius: 9px; border: 1.5px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.seg button.on-blue   { border-color: var(--blue);   color: var(--blue-ink); background: #f3f7ff; }
.seg button.on-amber  { border-color: var(--amber);  color: var(--amber);    background: #fffaf0; }
.seg button.on-green  { border-color: var(--green);  color: var(--green);    background: #f0faf6; }
.search { position: relative; }
.search input { width: 192px; padding: 8px 12px 8px 32px; border-radius: 9px; border: 1.5px solid var(--border); font-size: 13px; background: var(--surface); color: var(--ink); font-family: inherit; }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,246,.12); }
.search .si { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 13px; pointer-events: none; }

/* ============================================================
   DATA TABLE
   ============================================================ */
.dt-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: visible; }
.dt-scroll { overflow-x: auto; border-radius: var(--r-lg); }
.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.dt thead th {
  background: var(--surface-2); text-align: left;
  font-size: 11px; font-weight: 800; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .5px; white-space: nowrap;
}
.dt thead tr.head-row th {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 110px; z-index: 18; background: var(--surface-2);
  cursor: pointer; user-select: none;
}
.dt thead tr.head-row th:hover { background: #eef0f4; color: var(--ink-2); }
.dt thead tr.head-row th .sort-ico { margin-left: 5px; font-size: 10px; opacity: .5; }
.dt thead tr.head-row th.sorted { color: var(--blue-ink); }
.dt thead tr.head-row th.sorted .sort-ico { opacity: 1; }
.dt tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.dt tbody tr { cursor: pointer; transition: background .08s; }
.dt tbody tr:hover { background: #f9fbff; }
.dt tbody tr.warn { background: var(--yellow-row); }
.dt tbody tr.warn:hover { background: #fff7df; }
.dt tbody tr:last-child td { border-bottom: none; }

/* ---- Table cells ---- */
.cell-strong { font-weight: 700; color: var(--ink); }
.cell-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.cell-amount { font-weight: 800; color: var(--blue-ink); font-size: 14px; }
.cell-muted { color: var(--ink-3); }
.cell-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12px; }

/* ---- Pagination ---- */
.dt-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--border); gap: 14px; flex-wrap: wrap;
}
.dt-foot .pg-info { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.pg { display: flex; align-items: center; gap: 4px; }
.pg button {
  min-width: 32px; height: 32px; padding: 0 9px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: 13px; font-weight: 700; color: var(--ink-2);
}
.pg button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue-ink); }
.pg button.active { background: var(--grad); color: #fff; border-color: transparent; }
.pg button:disabled { opacity: .4; cursor: default; }
.pg-size { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.pg-size select { padding: 5px 8px; border-radius: 8px; border: 1.5px solid var(--border); font-size: 12.5px; font-family: inherit; background: var(--surface); color: var(--ink); }

/* ============================================================
   BADGES
   ============================================================ */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.b-slate  { background: var(--slate-bg);  color: var(--ink-2); }
.b-blue   { background: #e7eefe;          color: var(--blue-ink); }
.b-green  { background: var(--green-bg);  color: var(--green); }
.b-amber  { background: var(--amber-bg);  color: var(--amber); }
.b-orange { background: var(--orange-bg); color: var(--orange); }
.b-violet { background: #ede7fe;          color: #6d3fe0; }
.b-red    { background: var(--red-bg);    color: var(--red); }
.b-cyan   { background: var(--cyan-bg);   color: var(--cyan); }
.b-outline{ background: transparent; border: 1.5px solid var(--border); color: var(--ink-2); }

/* solid badges */
.sbadge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 9px; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; }
.sb-slate  { background: #6b7384; }
.sb-blue   { background: var(--blue); }
.sb-green  { background: var(--green); }
.sb-amber  { background: var(--amber); }
.sb-orange { background: var(--orange); }
.sb-violet { background: #7c5cf6; }
.sb-red    { background: var(--red); }
.sb-cyan   { background: var(--cyan); }

/* priority dots */
.prio-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.prio-1 { background: var(--slate); }
.prio-2 { background: var(--amber); }
.prio-3 { background: var(--red); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 700; border: 1.5px solid transparent; cursor: pointer; transition: background .12s, transform .08s; }
.btn:active { transform: scale(.98); }
.btn-grad { background: var(--grad); color: #fff; box-shadow: var(--sh); border: none; }
.btn-grad:hover { background: var(--grad-hover); }
.btn-primary { background: var(--blue); color: #fff; border-color: transparent; }
.btn-primary:hover { background: var(--blue-ink); }
.btn-out-blue { background: #f4f8ff; color: var(--blue-ink); border-color: #d7e4fe; }
.btn-out-blue:hover { background: #ecf3ff; }
.btn-out-green { background: #f1faf5; color: var(--green); border-color: #c8ecd9; }
.btn-out-green:hover { background: #e5f7ee; }
.btn-out-amber { background: #fffbf0; color: var(--amber); border-color: #f6e0a0; }
.btn-out-orange { background: #fff8f1; color: var(--orange); border-color: #f6dcbf; }
.btn-out-red { background: #fef5f4; color: var(--red); border-color: #f6cfca; }
.btn-out-red:hover { background: #fdeceb; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 9px; }
.btn-xs { padding: 4px 9px; font-size: 11.5px; border-radius: 7px; }

/* ============================================================
   CARDS & GENERIC
   ============================================================ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border-2); }
.card-title { font-weight: 800; font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.empty { padding: 60px 20px; text-align: center; color: var(--ink-3); }
.empty .e-ico { font-size: 40px; margin-bottom: 12px; }
.empty .e-title { font-size: 15px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }

/* KPI cards */
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-sm); }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .k-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; }
.kpi .k-val { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin-top: 6px; }
.kpi .k-lbl { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.kpi .k-delta { font-size: 12px; font-weight: 700; margin-top: 4px; }
.k-ico.ico-blue   { background: #eef3fe; }
.k-ico.ico-green  { background: var(--green-bg); }
.k-ico.ico-amber  { background: var(--amber-bg); }
.k-ico.ico-orange { background: var(--orange-bg); }
.k-ico.ico-violet { background: #ede7fe; }
.k-ico.ico-red    { background: var(--red-bg); }

/* ============================================================
   SLIDE-IN PANEL (right drawer — zastępuje modal)
   ============================================================ */
.panel-overlay { position: fixed; inset: 0; background: rgba(20,25,40,.45); backdrop-filter: blur(2px); z-index: 100; display: flex; justify-content: flex-end; }
.panel-drawer { background: var(--surface); width: 1040px; max-width: 96vw; height: 100vh; box-shadow: var(--sh-lg); display: flex; flex-direction: column; animation: slidein .22s cubic-bezier(.2,.8,.2,1); }
@keyframes slidein { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 14px; }
.panel-title { font-size: 19px; font-weight: 800; }
.panel-x { width: 34px; height: 34px; border-radius: 9px; border: none; background: var(--surface-2); color: var(--ink-2); font-size: 17px; display: grid; place-items: center; }
.panel-x:hover { background: #eceef3; }
.panel-tabs { display: flex; gap: 8px; padding: 0 24px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.ptab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 10px; background: var(--surface-2); border: none; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ptab:hover { background: #eceef3; }
.ptab.active { background: var(--grad); color: #fff; box-shadow: var(--sh); }
.ptab .pt-badge { background: rgba(0,0,0,.12); padding: 0 7px; border-radius: 8px; font-size: 11px; font-weight: 800; }
.ptab.active .pt-badge { background: rgba(255,255,255,.28); }
.panel-body { flex: 1; overflow-y: auto; padding: 22px 24px; }
.panel-actions { border-top: 1px solid var(--border); padding: 16px 24px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.actions-row { display: flex; gap: 10px; }
.actions-row > * { flex: 1; }

/* ============================================================
   DETAIL SECTIONS (inside panel)
   ============================================================ */
.dsec { padding: 16px 0; border-bottom: 1px solid var(--border-2); }
.dsec:last-child { border-bottom: none; }
.dlabel { font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 7px; }
.dbig { font-size: 26px; font-weight: 800; letter-spacing: -.4px; }
.dsubcode { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.damount { font-size: 30px; font-weight: 800; color: var(--blue-ink); letter-spacing: -.5px; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.kv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 28px; }
.kv .k { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; }
.kv .v { font-size: 14px; font-weight: 600; margin-top: 3px; }
.kv .v small { color: var(--ink-3); font-weight: 500; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 13.5px; font-family: inherit;
  color: var(--ink); background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.form-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,246,.12); }
.form-input::placeholder { color: var(--ink-3); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a93a6' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.form-textarea { min-height: 90px; resize: vertical; }
.form-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ============================================================
   OFFER BUILDER
   ============================================================ */
.ob-overlay { position: fixed; inset: 0; background: rgba(20,25,40,.5); backdrop-filter: blur(2px); z-index: 110; display: grid; place-items: center; padding: 18px; }
.ob { background: var(--surface); width: 1500px; max-width: 98vw; height: 94vh; border-radius: 16px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden; }
.ob-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--border); gap: 12px; }
.ob-body { flex: 1; display: grid; grid-template-columns: 268px 1fr 430px; overflow: hidden; min-height: 0; }
.ob-col { overflow-y: auto; }
.ob-col-head { padding: 12px; font-weight: 800; font-size: 12.5px; border-bottom: 1px solid var(--border-2); position: sticky; top: 0; background: var(--surface); z-index: 2; }

/* left col: devices */
.ob-devices { background: var(--surface-2); border-right: 1px solid var(--border); }
.ob-dev { padding: 11px 12px; border-bottom: 1px solid var(--border-2); cursor: pointer; }
.ob-dev:hover { background: #fff; }
.ob-dev.active { background: #eef3fe; border-left: 3px solid var(--blue); padding-left: 9px; }
.ob-dev-name { font-weight: 700; font-size: 13px; }
.ob-dev-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* middle col: line items */
.ob-editor { border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.ob-dev-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.ob-group { padding: 4px 0; }
.ob-group-head { padding: 7px 16px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.ob-group-head.g-robocizna { background: #eef3fe; color: var(--blue-ink); }
.ob-group-head.g-materialy  { background: #eafaf1; color: var(--green); }
.ob-group-head.g-uslugi     { background: #f5f0ff; color: #6d3fe0; }
.ob-item { display: flex; align-items: center; gap: 8px; padding: 7px 16px; border-bottom: 1px solid #f3f4f6; }
.ob-item:hover { background: var(--surface-2); }
.ob-item input[type="number"] { width: 64px; padding: 5px 6px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 12.5px; text-align: right; font-family: inherit; }
.ob-item input[type="number"]:focus { outline: none; border-color: var(--blue); }
.ob-name { border: 1.5px solid transparent; border-radius: 6px; padding: 4px 6px; font-size: 13px; font-family: inherit; flex: 1; background: transparent; font-weight: 600; }
.ob-name:hover { border-color: var(--border); background: #fff; }
.ob-name:focus { outline: none; border-color: var(--blue); background: #fff; }
.ob-unit { font-size: 12px; color: var(--ink-3); width: 30px; flex-shrink: 0; }
.ob-total { font-weight: 800; font-size: 13px; width: 92px; text-align: right; color: var(--blue-ink); flex-shrink: 0; }
.ob-x { border: none; background: none; color: var(--ink-3); font-size: 12px; width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; }
.ob-x:hover { background: var(--red-bg); color: var(--red); }
.ob-add { margin: 4px 16px 8px; font-size: 12px; color: var(--blue-ink); background: none; border: 1.5px dashed var(--border); border-radius: 8px; padding: 6px 10px; font-weight: 700; display: block; text-align: left; }
.ob-add:hover { border-color: var(--blue); background: #f6f9ff; }
.ob-services { padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface-2); margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.ob-srv { font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: #fff; border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.ob-srv:hover { border-color: var(--blue); color: var(--blue-ink); }

/* right col: PDF preview */
.ob-preview { background: #f1f3f7; padding: 18px; overflow-y: auto; }
.pdf { background: #fff; border-radius: 10px; box-shadow: var(--sh); padding: 22px; font-size: 12px; }
.pdf-logo { font-size: 18px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 12px; }
.pdf-title { font-size: 20px; font-weight: 800; margin: 12px 0 4px; }
.pdf-nr { font-size: 12px; color: var(--ink-3); font-family: ui-monospace, Menlo, monospace; }
.pdf-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.pdf-dev { margin-top: 14px; padding: 12px; background: var(--surface-2); border-radius: 9px; }
.pdf-tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11px; }
.pdf-tbl th { text-align: left; padding: 6px; border-bottom: 1.5px solid var(--border); font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); }
.pdf-tbl td { padding: 6px; border-bottom: 1px solid var(--border-2); vertical-align: top; }
.pdf-totals { margin-top: 12px; margin-left: auto; width: 220px; }
.pdf-totals div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.pdf-totals .grand { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 8px; font-size: 15px; }
.pdf-totals .grand b { color: var(--blue-ink); }
.ob-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--border); gap: 16px; }
.ob-foot-totals { display: flex; gap: 28px; align-items: center; }
.ob-foot-total-item { text-align: center; }
.ob-foot-total-item .label { font-size: 10.5px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.ob-foot-total-item .value { font-size: 18px; font-weight: 800; color: var(--ink); }
.ob-foot-total-item.grand .value { color: var(--blue-ink); font-size: 22px; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 6px; }
.tl-item { position: relative; padding: 0 0 22px 30px; }
.tl-item::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -4px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.d-slate  { background: #6b7384; } .d-amber  { background: var(--amber); }
.d-green  { background: var(--green); } .d-blue  { background: var(--blue); }
.d-violet { background: #7c5cf6; } .d-orange { background: var(--orange); }
.d-cyan   { background: var(--cyan); } .d-red   { background: var(--red); }
.tl-ts { font-size: 11.5px; color: var(--ink-3); }
.tl-title { font-weight: 700; font-size: 13.5px; margin-top: 1px; }
.tl-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }

/* ============================================================
   OFFER STATUS PIPELINE (pozioma linia statusów)
   ============================================================ */
.status-pipeline { display: flex; align-items: center; gap: 0; margin-bottom: 20px; overflow-x: auto; }
.sp-step { display: flex; align-items: center; gap: 0; }
.sp-node { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 90px; padding: 0 6px; }
.sp-circle { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; border: 2.5px solid var(--border); background: var(--surface); color: var(--ink-3); transition: all .15s; }
.sp-circle.done { background: var(--green); border-color: var(--green); color: #fff; }
.sp-circle.active { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 4px rgba(47,107,246,.2); }
.sp-circle.pending { background: var(--surface-2); }
.sp-label { font-size: 10.5px; font-weight: 700; color: var(--ink-3); text-align: center; white-space: nowrap; }
.sp-label.done { color: var(--green); }
.sp-label.active { color: var(--blue-ink); }
.sp-line { flex: 1; height: 2px; background: var(--border); min-width: 24px; }
.sp-line.done { background: var(--green); }

/* ============================================================
   SKELETON LOADER
   ============================================================ */
@keyframes shimmer { 0% { background-position: -360px 0; } 100% { background-position: 360px 0; } }
.skel { display: inline-block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef0f4 25%, #e2e6ee 37%, #eef0f4 63%); background-size: 720px 100%; animation: shimmer 1.25s infinite linear; }
.skel-line { display: block; width: 100%; height: 13px; border-radius: 6px; margin-bottom: 8px; background: linear-gradient(90deg, #eef0f4 25%, #e2e6ee 37%, #eef0f4 63%); background-size: 720px 100%; animation: shimmer 1.25s infinite linear; }
.skel-line.w-50 { width: 50%; }
.skel-line.w-70 { width: 70%; }

/* ============================================================
   FLASH / ALERTS
   ============================================================ */
.flash { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-radius: 11px; font-size: 13.5px; font-weight: 600; margin-bottom: 16px; }
.flash-success { background: var(--green-bg); color: var(--green); border: 1px solid #c2e9d5; }
.flash-error   { background: var(--red-bg);   color: var(--red);   border: 1px solid #f2c4c0; }
.flash-warning { background: var(--amber-bg); color: var(--amber); border: 1px solid #f2d98a; }
.flash-info    { background: #eef3fe;          color: var(--blue-ink); border: 1px solid #c9d9fe; }

/* ============================================================
   UTILITIES
   ============================================================ */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-8  { display: flex; align-items: center; gap: 8px; }
.flex-gap-12 { display: flex; align-items: center; gap: 12px; }
.flex-gap-16 { display: flex; align-items: center; gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--ink-3); }
.text-small { font-size: 12px; }
.font-bold  { font-weight: 700; }
.font-black { font-weight: 800; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }

/* ============================================================
   DENSITY
   ============================================================ */
:root[data-density="comfy"] .dt tbody td { padding: 18px 16px; }
:root[data-density="comfy"] .stab { padding: 11px 16px; }

/* ====== DOKLEJKA: zaawansowane style z prototypu (dashboard/mapa/planer/komunikator/oferty/panele) ====== */

/* ---------- Real map (Leaflet) ---------- */
.real-map { width: 100%; border-radius: 0 0 14px 14px; overflow: hidden; z-index: 1; }
.leaflet-container { font-family: var(--font); background: #eaf0f8; }
.leaflet-tooltip { border: none; box-shadow: var(--sh); border-radius: 8px; font-size: 12px; padding: 5px 9px; }
.veh-icon { background: none; border: none; }
.veh-dot { position: relative; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2.5px solid var(--vc); display: grid; place-items: center; font-size: 15px; box-shadow: 0 3px 10px rgba(20,25,40,.28); }
.veh-pulse { position: absolute; inset: -2px; border-radius: 50%; opacity: .45; animation: pulse 1.8s infinite ease-out; }
.veh-name { position: absolute; top: 31px; left: 50%; transform: translateX(-50%); background: var(--vc, #1f2430); color: #fff; font-size: 9.5px; font-weight: 800; padding: 1px 6px; border-radius: 6px; white-space: nowrap; box-shadow: var(--sh-sm); }
.veh-dot.veh-static { background: #fff; }
.veh-bul { width: 13px; height: 13px; border-radius: 50%; display: block; border: 2px solid #fff; }

/* ---------- Pulpit — odświeżony, nowoczesny ---------- */
.sd-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; border-radius: 18px; margin-bottom: 16px; color: #fff; background: linear-gradient(115deg, #2f4fd8 0%, #6b46e0 55%, #8b5cf6 100%); position: relative; overflow: hidden; box-shadow: 0 14px 40px rgba(75,70,180,.28); }
.sd-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.10); }
.sd-hero::before { content: ""; position: absolute; right: 120px; bottom: -90px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.07); }
.sd-hero .h-greet { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.sd-hero .h-sub { opacity: .9; font-size: 13.5px; margin-top: 3px; }
.sd-hero .h-clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.sd-hero .h-stats { display: flex; gap: 22px; position: relative; z-index: 2; }
.sd-hero .h-stat { text-align: center; }
.sd-hero .h-stat b { font-size: 24px; font-weight: 800; display: block; }
.sd-hero .h-stat span { font-size: 11.5px; opacity: .85; }
.sd-hero .h-cta { background: #fff; color: var(--blue-ink); border: none; border-radius: 11px; padding: 11px 18px; font-weight: 800; font-size: 13.5px; position: relative; z-index: 2; box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.sd-kpi { transition: transform .15s, box-shadow .15s; border-radius: 16px; }
.sd-map-hero { grid-column: 1 / -1; }
.sd-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--green); }
.sd-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(16,163,106,.5); animation: livedot 1.6s infinite; }
@keyframes livedot { 0% { box-shadow: 0 0 0 0 rgba(16,163,106,.45); } 100% { box-shadow: 0 0 0 8px rgba(16,163,106,0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sd > * { opacity: 1; }
.sd-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.sd-kpi { transition: transform .15s, box-shadow .15s; }
.sd-kpi:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.sd-kpi .k-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.sd-spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.sd-spark span { width: 6px; border-radius: 3px; display: block; transition: height .3s; }
.sd-row2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin-bottom: 16px; }
.sd-row3 { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.sd-card-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border-2); }

/* mapa */
.sd-map { overflow: hidden; display: flex; flex-direction: column; }
.sd-legend { display: flex; gap: 12px; font-size: 11.5px; color: var(--ink-2); font-weight: 600; flex-wrap: wrap; }
.sd-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.sd-map-body { position: relative; flex: 1; min-height: 330px; background: linear-gradient(160deg, #f3f6fb, #eaf0f8); overflow: hidden; }
.sd-map-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(47,107,246,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(47,107,246,.06) 1px, transparent 1px); background-size: 34px 34px; }
.sd-poland { position: absolute; left: 22%; top: 8%; width: 56%; height: 84%; background: radial-gradient(ellipse at center, rgba(47,107,246,.10), rgba(47,107,246,.03) 70%, transparent); border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%; border: 1.5px dashed rgba(47,107,246,.22); }
.map-pin { position: absolute; transform: translate(-50%, -50%); cursor: pointer; }
.map-pin .map-dot { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: var(--sh-sm); position: relative; z-index: 2; }
.map-pin .map-pulse { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); opacity: .5; animation: pulse 1.8s infinite ease-out; }
@keyframes pulse { 0% { transform: translate(-50%, -50%) scale(1); opacity: .5; } 100% { transform: translate(-50%, -50%) scale(3.4); opacity: 0; } }
.map-pin.due .map-dot, .map-pin.due { width: 9px; height: 9px; background: #c2cad8; border-radius: 50%; border: 2px solid #fff; }
.map-pin .map-tip { position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: #1f2430; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 11px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5; line-height: 1.35; }
.map-pin:hover .map-tip { opacity: 1; }
.sd-map-foot { display: flex; gap: 22px; padding: 12px 18px; border-top: 1px solid var(--border-2); font-size: 12.5px; color: var(--ink-2); }
.sd-map-foot b { color: var(--ink); }

/* maile */
.sd-mails { display: flex; flex-direction: column; }
.sd-mail-list { padding: 6px; overflow-y: auto; }
.sd-mail { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 10px; cursor: pointer; transition: background .1s; }
.sd-mail:hover { background: var(--surface-2); }
.sd-mail-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex-shrink: 0; }
.sd-mail-dot.unread { background: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,246,.16); }

/* oferty / ekipy */
.sd-offer { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; background: var(--surface-2); cursor: pointer; transition: transform .1s; }
.sd-offer:hover { transform: translateX(3px); }
.sd-jobchip { border: 1.5px solid var(--border); background: #fff; border-radius: 8px; padding: 5px 9px; font-size: 11.5px; color: var(--ink-2); }
.sd-jobchip:hover { border-color: var(--blue); color: var(--blue-ink); }
.sd-jobchip b { color: var(--ink); }

/* SafeMail convert cards */
.convert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.convert-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); text-align: left; transition: transform .12s, border-color .12s, box-shadow .12s; }
.convert-card:hover { transform: translateY(-2px); border-color: var(--blue); box-shadow: var(--sh); }
.convert-card .cc-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; margin-bottom: 6px; }
.convert-card .cc-t { font-weight: 800; font-size: 14px; }
.convert-card .cc-s { font-size: 11.5px; color: var(--ink-3); font-weight: 600; font-family: ui-monospace, Menlo, monospace; }

/* compose */
.compose { position: fixed; right: 24px; bottom: 24px; width: 460px; max-width: 94vw; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--sh-lg); z-index: 120; overflow: hidden; animation: fadeUp .22s both; }
.compose-head { background: var(--grad); color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.compose-head button { background: rgba(255,255,255,.2); border: none; color: #fff; width: 28px; height: 28px; border-radius: 8px; }
.compose-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.compose-body label { font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; }
.compose-body input, .compose-body textarea, .compose-body select { width: 100%; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 13px; font-family: inherit; }
.compose-body input:focus, .compose-body textarea:focus { outline: none; border-color: var(--blue); }
.compose-foot { display: flex; gap: 10px; padding: 0 16px 16px; }

/* ---------- Offer Builder ---------- */
.ob-overlay { position: fixed; inset: 0; background: rgba(20,25,40,.5); backdrop-filter: blur(2px); z-index: 110; display: grid; place-items: center; padding: 18px; }
.ob { background: var(--surface); width: 1500px; max-width: 98vw; height: 94vh; border-radius: 16px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden; }
.ob-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.ob-body { flex: 1; display: grid; grid-template-columns: 268px 1fr 430px; overflow: hidden; }
.ob-col { overflow-y: auto; }
.ob-col-head { padding: 12px; font-weight: 800; font-size: 12.5px; border-bottom: 1px solid var(--border-2); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.ob-devices { background: var(--surface-2); border-right: 1px solid var(--border); }
.ob-dev { padding: 11px 12px; border-bottom: 1px solid var(--border-2); cursor: pointer; }
.ob-dev:hover { background: #fff; }
.ob-dev.active { background: #eef3fe; border-left: 3px solid var(--blue); padding-left: 9px; }
.ob-editor { border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.ob-dev-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.ob-group { padding: 4px 0; }
.ob-group-head { padding: 7px 16px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.ob-group-head.g-robocizna { background: #eef3fe; color: var(--blue-ink); }
.ob-group-head.g-materialy { background: #eafaf1; color: var(--green); }
.ob-group-head.g-uslugi { background: #f5f0ff; color: #6d3fe0; }
.ob-item { display: flex; align-items: center; gap: 8px; padding: 7px 16px; border-bottom: 1px solid #f3f4f6; }
.ob-item:hover { background: var(--surface-2); }
.ob-name { border: 1.5px solid transparent; border-radius: 6px; padding: 4px 6px; font-size: 13px; font-family: inherit; width: 100%; background: transparent; font-weight: 600; }
.ob-name:hover { border-color: var(--border); background: #fff; }
.ob-name:focus { outline: none; border-color: var(--blue); background: #fff; }
.ob-unit { font-size: 12px; color: var(--ink-3); width: 30px; }
.ob-total { font-weight: 800; font-size: 13px; width: 92px; text-align: right; color: var(--blue-ink); }
.ob-x { border: none; background: none; color: var(--ink-3); font-size: 12px; width: 22px; height: 22px; border-radius: 6px; }
.ob-x:hover { background: var(--red-bg); color: var(--red); }
.ob-add { margin: 4px 16px 8px; font-size: 12px; color: var(--blue-ink); background: none; border: 1.5px dashed var(--border); border-radius: 8px; padding: 6px 10px; font-weight: 700; }
.ob-add:hover { border-color: var(--blue); background: #f6f9ff; }
.ob-services { padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface-2); margin-top: auto; }
.ob-srv { font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: #fff; border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.ob-srv:hover { border-color: var(--blue); color: var(--blue-ink); }
.ob-srv.ai { background: var(--grad); color: #fff; border: none; }
.ob-preview { background: #f1f3f7; padding: 18px; }
.pdf { background: #fff; border-radius: 10px; box-shadow: var(--sh); padding: 22px; font-size: 12px; }
.pdf-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.pdf-dev { margin-top: 14px; padding: 12px; background: var(--surface-2); border-radius: 9px; }
.pdf-tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11px; }
.pdf-tbl th { text-align: left; padding: 6px 6px; border-bottom: 1.5px solid var(--border); font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); }
.pdf-tbl td { padding: 6px 6px; border-bottom: 1px solid var(--border-2); vertical-align: top; }
.pdf-totals { margin-top: 12px; margin-left: auto; width: 220px; }
.pdf-totals div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.pdf-totals .grand { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 8px; font-size: 15px; }
.pdf-totals .grand b { color: var(--blue-ink); }
.ob-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--border); gap: 16px; }
.ob-foot-totals { display: flex; gap: 28px; align-items: center; }

/* ---------- Panel Stack (drill-down kolumnowy) ---------- */
.stage { transition: transform .32s cubic-bezier(.22,.7,.25,1), filter .32s; transform-origin: left center; }
.stage.pushed { transform: translateX(calc(-1 * var(--push, 0px))); filter: brightness(.985); }
.panel-scrim { position: fixed; inset: 0; background: rgba(20,25,40,.34); backdrop-filter: blur(1.5px); z-index: 190; animation: scrimIn .25s both; }
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
.panel { position: fixed; top: 0; bottom: 0; background: transparent; transition: left .32s cubic-bezier(.22,.7,.25,1); animation: panelIn .34s cubic-bezier(.22,.7,.25,1) both; }
@keyframes panelIn { from { transform: translateX(46px); opacity: .2; } to { transform: none; opacity: 1; } }
.panel-inner { position: absolute; inset: 0; background: var(--surface); box-shadow: -18px 0 50px rgba(20,25,40,.20); border-left: 1px solid var(--border); overflow: hidden; }
.panel.covered .panel-inner { filter: brightness(.92) saturate(.9); }
.panel.covered .panel-inner::after { content: ""; position: absolute; inset: 0; background: rgba(20,25,40,.10); z-index: 50; }
.panel-spine { position: absolute; top: 0; bottom: 0; left: 0; z-index: 60; background: linear-gradient(180deg, #fbfcfe, #f1f3f8); border: none; border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 16px 0; cursor: pointer; }
.panel-spine:hover { background: linear-gradient(180deg, #eef3fe, #e7eefe); }
.panel-spine-txt { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; font-weight: 800; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 70%; letter-spacing: .3px; }
.panel-spine-ico { font-size: 20px; color: var(--blue-ink); font-weight: 800; line-height: 1; }
.panel-spine:hover .panel-spine-txt { color: var(--blue-ink); }

/* karta treści panelu (zastępuje dawny .modal) */
.pcard { height: 100%; display: flex; flex-direction: column; background: var(--surface); }

/* AI box */
.ai-box { border: 1.5px solid #e2e8fe; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg,#f5f8ff,#f8f5ff); }
.ai-head { display: flex; align-items: center; gap: 9px; padding: 11px 13px; }
.ai-spark { font-size: 16px; }
.ai-title { font-weight: 800; font-size: 13px; }
.ai-tag { font-size: 10px; font-weight: 800; color: #6d3fe0; background: #ede7fe; padding: 2px 7px; border-radius: 7px; text-transform: uppercase; letter-spacing: .5px; }
.ai-run { margin-left: auto; background: var(--grad); color: #fff; border: none; border-radius: 9px; padding: 7px 13px; font-size: 12.5px; font-weight: 700; }
.ai-run:disabled { opacity: .6; }
.ai-hint { padding: 0 13px 13px; font-size: 12.5px; color: var(--ink-3); }
.ai-body { padding: 0 13px 13px; }
.ai-result { font-size: 13px; color: var(--ink); line-height: 1.5; background: #fff; margin: 0 10px 10px; padding: 12px; border-radius: 9px; border: 1px solid var(--border); }
.ai-actions { display: flex; gap: 8px; margin-top: 8px; }
.ai-actions .btn { width: auto; }

/* Planer kierownika */
.planer { display: grid; grid-template-columns: 350px 1fr 330px; gap: 16px; align-items: start; }
.planer-list, .planer-map, .planer-days { display: flex; flex-direction: column; }
.planer-jobs { overflow-y: auto; max-height: 600px; padding: 8px; }
.planer-job { display: flex; gap: 10px; padding: 10px; border-radius: 10px; border: 1px solid var(--border-2); margin-bottom: 7px; }
.planer-job:hover { background: var(--surface-2); }
.planer-job.hl { background: #eef3fe; border-color: #cfe0fe; }
.planer-job > div:first-child { cursor: pointer; }
.planer-assign { display: flex; gap: 4px; margin-top: 7px; justify-content: flex-end; }
.planer-assign button { width: 23px; height: 23px; border-radius: 7px; border: none; color: #fff; font-size: 11px; font-weight: 800; }
.planer-assign button:hover { transform: scale(1.12); }
.map-pin.hl { z-index: 8; }
.planer-days-body { overflow-y: auto; max-height: 600px; }
.planer-day { border-bottom: 1px solid var(--border-2); padding: 11px 13px; }
.planer-day-head { font-weight: 800; font-size: 12.5px; }
.planer-chip { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px; margin-top: 5px; font-size: 11.5px; }
.planer-chip > span { cursor: pointer; }
.planer-chip button { border: none; background: none; color: var(--ink-3); font-size: 12px; }
.planer-chip button:hover { color: var(--red); }

/* ---------- Komunikator ---------- */
.overlay-r { position: fixed; inset: 0; background: rgba(20,25,40,.42); z-index: 300; display: flex; justify-content: flex-end; }
.msgr { background: #fff; width: 880px; max-width: 96vw; height: 100vh; display: flex; flex-direction: column; box-shadow: var(--sh-lg); animation: slidein .22s cubic-bezier(.2,.8,.2,1); }
@keyframes slidein { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.msgr-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.msgr-body { flex: 1; display: grid; grid-template-columns: 300px 1fr; overflow: hidden; }
.msgr-list { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface-2); }
.msgr-thread { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border-2); cursor: pointer; }
.msgr-thread:hover { background: #fff; }
.msgr-thread.active { background: #eef3fe; box-shadow: inset 3px 0 0 var(--blue); }
.msgr-avs { display: flex; }
.msgr-unread { background: var(--red); color: #fff; font-size: 10px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
.msgr-conv { display: flex; flex-direction: column; overflow: hidden; }
.msgr-conv-head { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.msgr-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(180deg,#fbfcfe,#f6f8fb); }
.msgr-msg { display: flex; gap: 10px; max-width: 80%; }
.msgr-msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msgr-bubble { background: #fff; border: 1px solid var(--border); padding: 10px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; box-shadow: var(--sh-sm); }
.msgr-msg.mine .msgr-bubble { background: var(--grad); color: #fff; border: none; }
.msgr-composer { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); align-items: center; }
.msgr-composer input { flex: 1; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 11px; font-size: 13.5px; font-family: inherit; }
.msgr-composer input:focus { outline: none; border-color: var(--blue); }
.msgr-send { width: 44px; height: 44px; border-radius: 11px; border: none; background: var(--grad); color: #fff; font-size: 17px; }
.msgr-attach { width: 42px; height: 42px; border-radius: 11px; border: 1.5px solid var(--border); background: #fff; font-size: 17px; flex-shrink: 0; }
.msgr-attach:hover { border-color: var(--blue); }
.msgr-pending { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 18px 12px; }
.msgr-pchip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; font-size: 12px; }
.msgr-pchip button { border: none; background: none; color: var(--ink-3); font-size: 11px; }
.msgr-atts { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }
.att-img { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); max-width: 220px; background: #fff; }
.att-img img { display: block; width: 100%; max-height: 200px; object-fit: cover; }
.att-img .att-name { display: block; padding: 5px 9px; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-file { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; min-width: 220px; }
.att-file.mine { background: rgba(255,255,255,.92); }
.att-ico { font-size: 22px; }
.att-fname { font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-fsize { font-size: 11px; color: var(--ink-3); }
.att-dl { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface-2); color: var(--blue-ink); display: grid; place-items: center; text-decoration: none; font-size: 14px; flex-shrink: 0; }
.att-dl:hover { border-color: var(--blue); }

/* kadry */
.kadry-chip { border: 1.5px solid var(--border); background: #fff; border-radius: 20px; padding: 7px 14px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.kadry-chip.on { color: #fff; border-color: transparent; }
.kr-tbl { border-collapse: collapse; font-size: 11px; width: 100%; }
.kr-tbl th, .kr-tbl td { border: 1px solid var(--border-2); padding: 5px 4px; text-align: center; min-width: 30px; }
.kr-tbl .kr-side { text-align: left; font-weight: 700; white-space: nowrap; position: sticky; left: 0; background: #fff; min-width: 150px; padding-left: 10px; }
.kr-tbl thead th { background: var(--surface-2); font-weight: 800; }
.kr-wknd { background: #fef2f2; color: var(--red); }
.kr-tbl .kr-sum { font-weight: 800; background: var(--surface-2); }
.kr-plan td { background: #eef3fe; }
.kr-otd td { background: #fffbeb; }
.kr-otc td { background: #ecfdf5; color: var(--green); font-weight: 700; }
.kr-foot { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--border-2); border-top: 1px solid var(--border); }
.kr-foot > div { background: #fff; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.kr-foot b { font-size: 18px; }

/* brygady */
.crew-member { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border); background: #fff; border-radius: 9px; padding: 5px 9px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.crew-member.on { border-color: var(--blue); background: #eef3fe; color: var(--blue-ink); }

/* trasy planer */
.route-row { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 10px; padding: 11px 13px; }
.route-opt { border: 1.5px solid var(--border); background: #fff; border-radius: 8px; padding: 5px 9px; font-size: 10.5px; color: var(--ink-3); font-weight: 600; line-height: 1.3; text-align: center; }
.route-opt b { color: var(--ink); font-size: 11px; }
.route-opt.on { border-color: var(--blue); background: #eef3fe; color: var(--blue-ink); }
.route-opt.on b { color: var(--blue-ink); }

/* recipient picker */
.rcp { position: relative; margin-top: 6px; }
.rcp-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border: 1.5px solid var(--border); border-radius: 11px; padding: 9px 11px; min-height: 46px; cursor: pointer; }
.rcp-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef3fe; color: var(--blue-ink); border-radius: 8px; padding: 3px 6px 3px 4px; font-size: 12.5px; font-weight: 600; }
.rcp-chip button { border: none; background: none; color: var(--blue-ink); font-size: 11px; }
.rcp-caret { margin-left: auto; color: var(--ink-3); }
.rcp-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh-md); padding: 6px; z-index: 10; max-height: 280px; overflow-y: auto; }
.rcp-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.rcp-opt:hover { background: var(--surface-2); }
.rcp-opt input { width: 16px; height: 16px; accent-color: var(--blue); }

/* ---------- Powiadomienia ---------- */
.notif-pop { position: fixed; top: 58px; right: 96px; width: 380px; max-width: 92vw; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--sh-lg); z-index: 300; overflow: hidden; animation: fadeUp .2s both; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--border-2); }
.notif-push { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: linear-gradient(135deg,#f3f7ff,#f8f5ff); border-bottom: 1px solid var(--border-2); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--border-2); cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: #f6f9ff; }
.notif-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; }

/* ---------- Admin ---------- */
.adm-inp { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 13.5px; font-family: inherit; }
.adm-inp:focus { outline: none; border-color: var(--blue); }
.adm-roles { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-role { background: none; border: 1.5px solid transparent; border-radius: 10px; padding: 3px; }
.adm-role.on { border-color: var(--blue); background: #f3f7ff; }

/* ---------- Protokół na tablecie ---------- */
.ppad-overlay { position: fixed; inset: 0; background: rgba(20,25,40,.55); z-index: 320; display: grid; place-items: center; padding: 16px; }
.ppad { background: #eef0f4; width: 1100px; max-width: 98vw; height: 96vh; border-radius: 16px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden; }
.ppad-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--border); }
.ppad-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--border); }
.ppad-tools { display: flex; align-items: center; gap: 7px; }
.ppad-tools button { border: 1.5px solid var(--border); background: #fff; border-radius: 9px; padding: 7px 12px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.ppad-tools button.on { border-color: var(--blue); color: var(--blue-ink); background: #f3f7ff; }
.ppad-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); padding: 0; }
.ppad-color.on { box-shadow: 0 0 0 2px var(--blue); }
.ppad-scroll { flex: 1; overflow-y: auto; padding: 22px; display: flex; justify-content: center; }
.ppad-doc { position: relative; width: 800px; max-width: 100%; }
.pdoc { background: #fff; border-radius: 6px; box-shadow: var(--sh-md); padding: 34px 38px; min-height: 1000px; font-size: 13px; }
.pdoc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 20px; margin: 16px 0; }
.pdoc-section { font-weight: 800; text-transform: uppercase; letter-spacing: .5px; font-size: 12px; color: var(--ink-3); margin: 18px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.pdoc-check { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.pdoc-box { width: 18px; height: 18px; border: 1.5px solid #1f2430; border-radius: 3px; flex-shrink: 0; }
.pdoc-notes { height: 90px; border: 1px dashed var(--border); border-radius: 6px; }
.pdoc-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.pdoc-sigline { border-bottom: 1.5px solid #1f2430; height: 60px; }
.ppad-canvas { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.ppad-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: #fff; border-top: 1px solid var(--border); }

/* protokoły — wzory z polami */
.proto-doc { background: #fff; border-radius: 8px; box-shadow: var(--sh-md); padding: 28px 32px; width: 820px; max-width: 100%; }
.proto-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; padding-bottom: 14px; border-bottom: 2px solid #1f2430; margin-bottom: 16px; font-size: 13px; }
.proto-section { margin-bottom: 18px; }
.proto-section-title { font-weight: 800; text-transform: uppercase; letter-spacing: .5px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--border); padding-bottom: 5px; margin-bottom: 10px; }
.proto-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.proto-check { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; user-select: none; }
.proto-check:hover { background: var(--surface-2); }
.proto-check.on { border-color: var(--green); background: #f1faf5; color: var(--green); }
.proto-box { width: 22px; height: 22px; border: 1.5px solid var(--ink-3); border-radius: 5px; display: grid; place-items: center; font-weight: 800; color: var(--green); flex-shrink: 0; }
.proto-check.on .proto-box { border-color: var(--green); background: #fff; }
.proto-field, .proto-full { display: flex; flex-direction: column; }
.proto-full { grid-column: 1 / -1; }
.proto-input { padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 13px; font-family: inherit; }
.proto-input:focus { outline: none; border-color: var(--blue); }
.proto-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.sig-wrap { display: flex; flex-direction: column; }
.sig-canvas { border: 1.5px dashed var(--border); border-radius: 9px; height: 110px; touch-action: none; cursor: crosshair; background: #fff; }
.proto-pick { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px solid var(--border); border-radius: 12px; background: #fff; text-align: left; }
.proto-pick:hover { border-color: var(--blue); box-shadow: var(--sh); transform: translateY(-2px); transition: all .12s; }

/* ---------- Drzewo plików ---------- */
.ftree { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ftree-row { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border-2); }
.ftree-row:hover { background: var(--surface-2); }
.ftree-row.top { font-weight: 800; background: var(--surface-2); }
.ftree-caret { width: 14px; color: var(--ink-3); font-size: 11px; }
.ftree-sub .ftree-row { padding-left: 30px; font-weight: 600; }
.ftree-file { display: flex; align-items: center; gap: 9px; padding: 7px 14px 7px 46px; border-bottom: 1px solid var(--border-2); }
.ftree-file:hover { background: #f9fbff; }

/* ---------- Ryzyka ---------- */
.risk-row { background: var(--surface-2); border-radius: 10px; padding: 11px 13px; }

/* density tweak */
:root[data-density="comfy"] .tbl tbody td { padding: 18px 18px; }
:root[data-density="comfy"] .tbl thead th { padding: 15px 18px; }
:root[data-density="comfy"] .stab { padding: 11px 16px; }

/* ====== Mapa: siedziby (logo) + punkty startu ====== */
.hq-icon { background: none; border: none; }
.hq-pin { width: 46px; height: 46px; border-radius: 13px; background: #fff; border: 2.5px solid var(--blue); box-shadow: 0 4px 14px rgba(20,25,40,.30); display: grid; place-items: center; overflow: hidden; padding: 5px; }
.hq-pin.partner { border-color: var(--orange); }
.hq-pin img { width: 100%; height: 100%; object-fit: contain; }
.hq-name { position: absolute; top: 48px; left: 50%; transform: translateX(-50%); background: var(--blue-ink); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 6px; white-space: nowrap; box-shadow: var(--sh-sm); }
.hq-pin.partner + .hq-name { background: var(--orange); }
.start-icon { background: none; border: none; }
.start-pin { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--amber); display: grid; place-items: center; font-size: 14px; box-shadow: var(--sh-sm); }
.start-name { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); background: var(--amber); color: #fff; font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 5px; white-space: nowrap; }

/* logo EPS w headerze */
.eps-logo-img { height: 32px; display: block; }

/* ====== Poprawki: mniejsze kwadratowe logo HQ + animowane sparkline ====== */
.hq-pin { width: 34px; height: 34px; border-radius: 9px; padding: 3px; border-width: 2px; }
.hq-name { top: 37px; font-size: 9px; padding: 1px 6px; }
.start-pin { width: 24px; height: 24px; font-size: 12px; }

@keyframes growBar { from { height: 0 !important; opacity: 0; } }
.sd-spark span { animation: growBar .55s cubic-bezier(.2,.8,.2,1) both; }
.sd-spark span:nth-child(1) { animation-delay: .02s; }
.sd-spark span:nth-child(2) { animation-delay: .08s; }
.sd-spark span:nth-child(3) { animation-delay: .14s; }
.sd-spark span:nth-child(4) { animation-delay: .20s; }
.sd-spark span:nth-child(5) { animation-delay: .26s; }
.sd-spark span:nth-child(6) { animation-delay: .32s; }
.sd-kpi .k-top { display: flex; align-items: flex-start; justify-content: space-between; }

/* ====== Mapa: filtry ekip + pulsujące pojazdy ====== */
.map-filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--border-2); background: var(--surface); }
.map-filter-chip { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--border); background: #fff; border-radius: 20px; padding: 5px 12px; font-size: 12px; font-weight: 700; color: var(--ink-2); cursor: pointer; transition: all .12s; }
.map-filter-chip:hover { border-color: var(--blue); }
.map-filter-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.map-filter-chip.off { opacity: .45; text-decoration: line-through; background: var(--surface-2); }
/* pulsujące kółko pod pojazdem (przywrócone) */
.veh-dot .veh-pulse { position: absolute; inset: -2px; border-radius: 50%; opacity: .5; animation: pulse 1.8s infinite ease-out; }

/* ====== Logo HQ na mapie — wyraźnie mniejsze (override) ====== */
.hq-pin { width: 22px !important; height: 22px !important; border-radius: 6px !important; padding: 2px !important; border-width: 1.5px !important; }
.hq-name { top: 25px !important; font-size: 8px !important; padding: 1px 5px !important; }

/* ====== Panele drill-down: neutralizacja starego markup .overlay/.modal ====== */
/* Partiale paneli były pisane jako slide-over (.overlay+.modal). Wewnątrz panel-stack
   mają wypełniać kontener, nie pozycjonować się fixed. */
.panel-inner .overlay { position: static; inset: auto; background: none; backdrop-filter: none; display: block; height: 100%; }
.panel-inner .modal { width: 100%; max-width: none; height: 100%; box-shadow: none; animation: none; border-radius: 0; display: flex; flex-direction: column; }
.panel-inner turbo-frame { display: block; height: 100%; }

/* ====== Modal/panel chrome (nagłówek, body, akcje) — brakujące w Rails ====== */
.panel-inner .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.panel-inner .modal-title { font-size: 19px; font-weight: 800; }
.panel-inner .modal-x { width: 34px; height: 34px; border-radius: 9px; border: none; background: var(--surface-2); color: var(--ink-2); font-size: 17px; display: grid; place-items: center; text-decoration: none; cursor: pointer; }
.panel-inner .modal-x:hover { background: #eceef3; }
.panel-inner .modal-body { flex: 1; overflow-y: auto; padding: 22px 24px; }
.panel-inner .modal-actions { border-top: 1px solid var(--border); padding: 16px 24px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); flex-shrink: 0; }
.panel-inner .modal-actions .actions-row { display: flex; gap: 10px; }
.panel-inner .modal-actions .actions-row > * { flex: 1; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }

/* ====== Panel: animacja zamykania (lustrzane otwieranie) + scrim fade ====== */
.panel { transition: left .32s cubic-bezier(.22,.7,.25,1); }
.panel.closing { transition: transform .3s cubic-bezier(.4,0,.6,1), opacity .3s ease; transform: translateX(46px); opacity: 0; pointer-events: none; }
.panel-inner { transition: filter .25s; }
#ps-scrim { transition: opacity .3s; }

/* ====== Ekipy dziś: chipy godzina+miasto + km ====== */
.sd-crew { padding-left: 11px; margin-bottom: 14px; }
.sd-crew-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sd-crew-stops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.sd-stop { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--border); background: #fff; border-radius: 8px; padding: 4px 9px; font-size: 12px; color: var(--ink-2); cursor: pointer; transition: all .12s; }
.sd-stop b { color: var(--cc, var(--blue-ink)); font-weight: 800; }
.sd-stop:hover { border-color: var(--cc, var(--blue)); background: var(--surface-2); transform: translateY(-1px); }

/* ====== Panel: poprawny wewnętrzny scroll + przyklejone elementy ====== */
.panel-inner { display: flex; flex-direction: column; height: 100%; }
.panel-inner .overlay { position: static; inset: auto; background: none; backdrop-filter: none; display: flex; flex-direction: column; height: 100%; min-height: 0; }
.panel-inner .modal { width: 100%; max-width: none; height: 100%; box-shadow: none; animation: none; border-radius: 0; display: flex; flex-direction: column; min-height: 0; }
.panel-inner turbo-frame { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.panel-inner .modal-head { flex-shrink: 0; }
.panel-inner .modal-tabs { flex-shrink: 0; overflow-x: auto; }
.panel-inner .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.panel-inner .modal-actions { flex-shrink: 0; }
.mt-badge { display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 8px; background: rgba(0,0,0,.10); font-size: 11px; font-weight: 800; }
.mtab.active .mt-badge { background: rgba(255,255,255,.28); }

/* ====== Filter pills (aktywne filtry tabel) ====== */
.active-pills:empty { display: none; }
.active-pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; }
.filter-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; background: #e8f0fe; border: 1.5px solid #c5d8fd; border-radius: 9px; font-size: 12px; cursor: pointer; }
.filter-pill:hover { background: #d4e4fd; }
.fp-col { color: var(--ink-3); font-weight: 600; }
.fp-op { color: var(--ink-3); font-size: 11px; }
.fp-val { color: var(--blue-ink); font-weight: 700; }
.fp-x { color: var(--ink-3); margin-left: 2px; }

/* ====== Animacja zamykania (lustro otwierania) ====== */
.panel { animation: panelIn .32s cubic-bezier(.22,.7,.25,1); }
@keyframes panelIn { from { transform: translateX(46px); opacity: .2; } to { transform: none; opacity: 1; } }
.panel.closing { animation: none; transition: transform .3s cubic-bezier(.4,0,.6,1), opacity .3s ease; transform: translateX(48px); opacity: 0; pointer-events: none; }

/* ====== Grzbiet zakrytego panelu — szerszy i wyraźniejszy ====== */
.panel.covered .panel-inner { pointer-events: none; }
.panel-spine { position: absolute; top: 0; left: 0; bottom: 0; width: 72px; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(180deg, #fbfcfe, #eef1f6); border: none; border-right: 1px solid var(--border);
  cursor: pointer; transition: background .15s; }
.panel-spine:hover { background: linear-gradient(180deg, #eef3fe, #dfeafe); }
.panel-spine-ico { font-size: 26px; font-weight: 800; color: var(--blue-ink); line-height: 1; }
.panel-spine-txt { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 13px; font-weight: 800;
  color: var(--ink-2); letter-spacing: .4px; white-space: nowrap; max-height: 70%; overflow: hidden; text-overflow: ellipsis; }
.panel-spine:hover .panel-spine-txt { color: var(--blue-ink); }
.panel.covered .panel-inner::after { content: ""; position: absolute; inset: 0; background: rgba(20,25,40,.06); z-index: 5; pointer-events: none; }

/* ====== Zakładki panelu (.mtab) — styl z prototypu ====== */
.panel-inner .modal-tabs, .modal-tabs { display: flex; gap: 8px; padding: 0 24px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.mtab { display: inline-flex !important; align-items: center; gap: 7px; padding: 8px 15px !important; border-radius: 10px !important; background: var(--surface-2) !important; border: none !important; font-size: 13px; font-weight: 600; color: var(--ink-2) !important; cursor: pointer; box-shadow: none !important; transition: background .12s, color .12s; }
.mtab:hover { background: #eceef3 !important; }
.mtab.active { background: var(--grad) !important; color: #fff !important; box-shadow: var(--sh) !important; }
.mtab .mt-badge { background: rgba(0,0,0,.12); padding: 0 7px; border-radius: 8px; font-size: 11px; font-weight: 800; }
.mtab.active .mt-badge { background: rgba(255,255,255,.28); }

/* ====== Sidebar polish: bez szarej kreski nad zakładkami + zakryty panel pokazuje tylko grzbiet ====== */
.panel-inner .modal-head { border-bottom: none !important; padding-bottom: 6px; }
.panel-inner .modal-tabs { padding-top: 4px; border-bottom: none !important; }

/* Zakryty panel: chowamy całą treść, zostaje tylko grzbiet (spine) */
.panel.covered .panel-inner { visibility: hidden; }
.panel.covered .panel-spine { visibility: visible; }
.panel.covered .panel-inner::after { display: none; }

/* ====== Grzbiet: domknięcie 6px dziury — szerokość = PEEK (78px) ====== */
.panel-spine { width: 80px !important; }

/* ====== Grzbiet: nagłówek u góry (strzałka + pionowy tytuł) ====== */
.panel-spine { justify-content: flex-start !important; padding-top: 18px !important; gap: 10px !important; }
.panel-spine-ico { font-size: 24px; }
.panel-spine-txt { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 13px; font-weight: 800; color: var(--ink-2); letter-spacing: .3px; white-space: nowrap; max-height: 80%; overflow: hidden; text-overflow: ellipsis; }
.panel-spine:hover .panel-spine-txt { color: var(--blue-ink); }

/* ====== Mapa: logo HQ (EPS) dopasowane do kwadratu, bez ucięcia ====== */
.hq-icon { background: none; border: none; }
.hq-pin { width: 36px; height: 36px; border-radius: 9px; background: #fff; border: 2px solid var(--blue); box-shadow: 0 3px 10px rgba(20,25,40,.25); display: grid; place-items: center; overflow: hidden; padding: 3px; }
.hq-pin img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.hq-pin.outsourcing { border-color: var(--amber); }
.hq-name { margin-top: 3px; font-size: 10px; font-weight: 800; color: var(--ink); background: #fff; padding: 1px 6px; border-radius: 6px; box-shadow: var(--sh-sm); white-space: nowrap; transform: translateX(calc(-50% + 18px)); display: inline-block; }

/* ====== Sparkline trend (7 dni, dziś najmocniejszy) ====== */
.sd-spark { display: flex; align-items: flex-end; gap: 3px; height: 36px; }
.spark-bar { width: 7px; border-radius: 3px 3px 1px 1px; transition: opacity .12s, transform .12s; cursor: default; }
.spark-bar:hover { transform: scaleY(1.06); opacity: 1 !important; }
.spark-bar.today { box-shadow: 0 0 0 1.5px rgba(255,255,255,.6) inset; }

/* ====== Mapa: logo HQ jako background (cover), bez ucięcia ====== */
.hq-icon { background: none; border: none; }
.hq-pin { width: 40px; height: 40px; border-radius: 10px; background-color: #fff; background-size: cover; background-position: center; background-repeat: no-repeat; border: 2px solid var(--blue); box-shadow: 0 3px 10px rgba(20,25,40,.28); }
.hq-pin.partner { border-color: var(--amber); }
.hq-name { margin-top: 3px; font-size: 10px; font-weight: 800; color: var(--ink); background: #fff; padding: 1px 6px; border-radius: 6px; box-shadow: var(--sh-sm); white-space: nowrap; transform: translateX(calc(-50% + 20px)); display: inline-block; }

/* ====== Ekipy: km na pillsie + pill powrotu/noclegu ====== */
.sd-stop-km { color: var(--ink-3); font-weight: 600; font-size: 11px; margin-left: 2px; }
.sd-stop-end { background: var(--surface-2); border-style: dashed; color: var(--ink-2); cursor: default; }
.sd-stop-end:hover { transform: none; border-color: var(--border); background: var(--surface-2); }

/* ====== Offer Builder w panelu slide-over (dopasowanie do .panel-inner) ====== */
.panel-inner .ob { position: static; width: 100%; height: 100%; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; min-height: 0; }
.panel-inner .ob-head { background: var(--grad); color: #fff; flex-shrink: 0; }
.panel-inner .ob-head .eps-mark { background: rgba(255,255,255,.18); }
.panel-inner .ob-head .cell-sub { color: rgba(255,255,255,.85); }
.panel-inner .ob-head .modal-x { background: rgba(255,255,255,.2); color: #fff; }
.panel-inner #offer_panel, .panel-inner turbo-frame#offer_panel { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.panel-inner .ob-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 230px 1fr 300px; overflow: hidden; }
.panel-inner .ob-col { overflow-y: auto; min-height: 0; }
.panel-inner .ob-foot { flex-shrink: 0; }
.ob-num { border: 1.5px solid var(--border); border-radius: 7px; padding: 5px 7px; font-size: 12.5px; font-family: inherit; text-align: right; }
.ob-srv form, .ai-run form { display: inline; }

/* 3 kolumny — każda scrolluje osobno, podgląd 50% */
.panel-inner .ob { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.panel-inner .ob-head { flex-shrink: 0; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; }
.panel-inner .ob-head .eps-mark { background: rgba(255,255,255,.18); }
.panel-inner .ob-clientbar { flex-shrink: 0; display: flex; align-items: center; gap: 9px; padding: 11px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.panel-inner #offer_content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ob-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 240px 1fr 50%; }
.ob-col { overflow-y: auto; min-height: 0; }
.ob-devices { border-right: 1px solid var(--border); background: var(--surface-2); }
.ob-editor { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ob-preview { border-left: 1px solid var(--border); background: #eef0f4; padding: 18px; }
.panel-inner .ob-foot { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 20px; border-top: 1px solid var(--border); background: #fff; }

.ob-col-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 12px 6px; font-weight: 800; font-size: 12.5px; }
.ob-mini-add { background: var(--blue); color: #fff; border: none; border-radius: 7px; width: 26px; height: 26px; cursor: pointer; font-size: 13px; }

/* karty urządzeń w kolumnie */
.ob-dev { margin: 0 10px 8px; padding: 10px; background: #fff; border: 2px solid var(--border); border-radius: 10px; transition: all .12s; }
.ob-dev.active { border-color: var(--blue); background: #f5f9ff; }
.ob-devcheck { padding: 0 !important; background: none !important; border: none !important; }
.ob-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); display: grid; place-items: center; font-weight: 800; color: #fff; background: #fff; cursor: pointer; font-size: 12px; flex-shrink: 0; }
.ob-dev.active .ob-check { background: var(--blue); border-color: var(--blue); }
.ob-edit-mini { background: var(--surface-2); border: none; border-radius: 6px; width: 26px; height: 26px; cursor: pointer; font-size: 12px; flex-shrink: 0; }
.ob-edit-mini:hover { background: #e6ebf5; }

/* pasek urządzenia w edytorze */
.ob-dev-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; background: var(--surface-2); border-radius: 10px; }

/* grupy pozycji */
.ob-group { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.ob-group-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface-2); font-weight: 800; font-size: 13px; border-bottom: 1px solid var(--border); }
.ob-group-sum { margin-left: auto; color: var(--blue-ink); }
.ob-item { display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-bottom: 1px solid var(--border-2); }
.ob-name { width: 100%; border: 1.5px solid transparent; border-radius: 7px; padding: 5px 8px; font-size: 13px; font-weight: 600; font-family: inherit; }
.ob-name:hover { border-color: var(--border); }
.ob-name:focus { outline: none; border-color: var(--blue); background: #f5f9ff; }
.ob-num { border: 1.5px solid var(--border); border-radius: 7px; padding: 5px 7px; font-size: 12.5px; font-family: inherit; text-align: right; }
.ob-num:focus { outline: none; border-color: var(--blue); }
.ob-dev-pick { border: 1.5px solid var(--border); border-radius: 7px; padding: 5px; font-size: 11px; font-family: inherit; max-width: 100px; }
.ob-unit { font-size: 11.5px; color: var(--ink-3); }
.ob-total { min-width: 80px; text-align: right; font-weight: 800; font-size: 12.5px; }
.ob-x { width: 24px; height: 24px; border-radius: 6px; border: none; background: none; color: var(--ink-3); cursor: pointer; text-decoration: none; display: grid; place-items: center; }
.ob-x:hover { background: var(--red-bg); color: var(--red); }
.ob-add { margin: 8px 13px; background: none; border: 1.5px dashed var(--border); border-radius: 8px; padding: 7px 11px; font-size: 12px; font-weight: 700; color: var(--blue-ink); cursor: pointer; width: auto; }
.ob-add:hover { border-color: var(--blue); background: #f5f9ff; }
.ob-services { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; }
.ob-srvgrid { display: flex; flex-wrap: wrap; gap: 7px; }
.ob-srv { background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 9px; padding: 6px 10px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.ob-srv:hover { border-color: var(--blue); color: var(--blue-ink); }
.ob-srv-price { color: var(--ink-3); font-weight: 800; }

/* podgląd PDF */
.ob-preview .pdf { background: #fff; border-radius: 10px; padding: 22px; box-shadow: var(--sh-sm); font-size: 12px; }
.pdf-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; }
.pdf-dev { margin: 12px 0 6px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }
.pdf-tbl { width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 8px; }
.pdf-tbl th { text-align: left; padding: 5px 6px; border-bottom: 2px solid var(--border); font-size: 10px; text-transform: uppercase; color: var(--ink-3); }
.pdf-tbl td { padding: 5px 6px; border-bottom: 1px solid var(--border-2); }
.pdf-totals { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.pdf-totals > div { display: flex; gap: 24px; font-size: 12px; }
.pdf-totals .grand { font-size: 15px; font-weight: 800; color: var(--blue-ink); border-top: 2px solid var(--border); padding-top: 6px; margin-top: 3px; }

/* stopka */
.panel-inner .ob-foot { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 20px; border-top: 1px solid var(--border); background: #fff; }
.ob-foot-totals { display: flex; gap: 24px; }
.ob-foot-totals > div { display: flex; flex-direction: column; }

/* CRM/Optima search modal */
.crm-overlay { position: fixed; inset: 0; background: rgba(20,25,40,.45); z-index: 400; display: grid; place-items: center; }
.crm-modal { background: #fff; width: 640px; max-width: 94vw; max-height: 84vh; border-radius: 16px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden; }
.crm-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; background: var(--grad); color: #fff; font-weight: 800; }
.crm-body { padding: 16px 18px; overflow-y: auto; }
.crm-srcrow { display: flex; gap: 8px; margin-bottom: 12px; }
.crm-srcrow input { flex: 1; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; }
.crm-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.crm-tab { padding: 6px 13px; border-radius: 8px; border: 1.5px solid var(--border); background: #fff; font-size: 12.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.crm-tab.on { background: var(--grad); color: #fff; border: none; }
.crm-res { display: flex; flex-direction: column; gap: 8px; }
.crm-card { border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; cursor: pointer; }
.crm-card:hover { border-color: var(--blue); background: #f6f9ff; }
/* SERWIS_EXTRAS_START (auto) */

/* === styles.css === */
/* SerwisApp — design tokens & global styles (styl DokApp) */
:root {
  --bg:        #eef0f4;
  --surface:   #ffffff;
  --surface-2: #f7f8fa;
  --border:    #e6e8ee;
  --border-2:  #eceef3;

  --ink:       #1f2430;
  --ink-2:     #515a6b;
  --ink-3:     #8a93a6;

  --blue:      #2f6bf6;
  --blue-ink:  #1f53d6;
  --violet:    #8b5cf6;
  --grad:      linear-gradient(95deg, #3b75f7 0%, #7c5cf6 100%);
  --grad-hover:linear-gradient(95deg, #2f64ef 0%, #6f49f2 100%);

  --green:     #10a36a;
  --green-bg:  #e7f7ef;
  --amber:     #e08a00;
  --amber-bg:  #fdf2dc;
  --orange:    #e8730c;
  --orange-bg: #fdeada;
  --red:       #e0453b;
  --red-bg:    #fdebe9;
  --slate:     #5b6478;
  --slate-bg:  #eef0f4;
  --cyan:      #0c8fb0;
  --cyan-bg:   #e0f4f9;
  --yellow-row:#fffbeb;
  --yellow-row-bd:#f6e7b0;

  --r-sm: 7px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --sh-sm: 0 1px 2px rgba(22,28,45,.06);
  --sh:    0 2px 8px rgba(22,28,45,.07);
  --sh-md: 0 6px 22px rgba(22,28,45,.10);
  --sh-lg: 0 18px 50px rgba(22,28,45,.22);

  --font: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #cfd4de; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6bdcb; background-clip: content-box; }

#root { min-height: 100vh; }
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Header ---------- */
.hdr { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.hdr-top { display: flex; align-items: center; gap: 18px; padding: 0 26px; height: 60px; }
.brand { display: flex; align-items: center; gap: 14px; }
.eps-logo { display: flex; align-items: center; gap: 9px; }
.eps-mark { width: 44px; height: 30px; background: #1d2330; color: #fff; border-radius: 5px; display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: .5px; position: relative; }
.eps-mark::after { content: "SYSTEM"; position: absolute; bottom: -11px; font-size: 6.5px; letter-spacing: 2px; color: var(--ink-3); font-weight: 700; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.brand-name .accent { color: var(--blue); }
.brand-divider { width: 1px; height: 28px; background: var(--border); }

.hdr-spacer { flex: 1; }
.hdr-user { display: flex; align-items: center; gap: 16px; }
.user-block { text-align: right; line-height: 1.15; }
.user-name { font-weight: 700; font-size: 13.5px; }
.user-role { font-size: 11px; color: var(--ink-3); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 9px; border: none; background: transparent; color: var(--ink-2); display: grid; place-items: center; font-size: 18px; }
.icon-btn:hover { background: var(--surface-2); }
.icon-badge { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.logout { color: var(--ink-2); font-size: 13px; background: none; border: none; padding: 7px 10px; border-radius: 8px; }
.logout:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Module nav ---------- */
.modnav { display: flex; align-items: center; gap: 4px; padding: 0 22px; height: 50px; border-top: 1px solid var(--border-2); background: var(--surface); overflow-x: auto; }
.modnav-item { display: flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); border: none; background: transparent; white-space: nowrap; }
.modnav-item .mi { font-size: 16px; opacity: .85; }
.modnav-item:hover { background: var(--surface-2); color: var(--ink); }
.modnav-item.active { background: #eef3fe; color: var(--blue-ink); }
.modnav-item .pill { background: var(--slate-bg); color: var(--ink-2); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 9px; }
.modnav-item.active .pill { background: var(--blue); color: #fff; }

/* ---------- Page frame ---------- */
.page { flex: 1; padding: 20px 26px 40px; max-width: 1840px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
.page-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.page-sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; }

/* ---------- Status tabs (zlecenia) ---------- */
.statustabs { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.stab { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 11px; background: transparent; border: 1px solid transparent; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.stab:hover { background: var(--surface); box-shadow: var(--sh-sm); }
.stab.active { background: var(--surface); box-shadow: var(--sh); color: var(--ink); border-color: var(--border); }
.stab .se { font-size: 15px; }
.stab .cnt { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 9px; }
.stab-group { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.stab-group .gl { font-size: 10px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .6px; padding: 0 8px 0 6px; }

.cnt.c-slate  { background: var(--slate-bg);  color: var(--ink-2); }
.cnt.c-blue   { background: #e4ecfe;          color: var(--blue-ink); }
.cnt.c-green  { background: var(--green-bg);  color: var(--green); }
.cnt.c-amber  { background: var(--amber-bg);  color: var(--amber); }
.cnt.c-orange { background: var(--orange-bg); color: var(--orange); }
.cnt.c-violet { background: #ede7fe;          color: #6d3fe0; }
.cnt.c-red    { background: var(--red-bg);    color: var(--red); }
.cnt.c-cyan   { background: var(--cyan-bg);   color: var(--cyan); }

/* ---------- Filter bar ---------- */
.filterbar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 13px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; box-shadow: var(--sh-sm); margin-bottom: 14px; }
.fb-label { font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .6px; }
.fb-group { display: flex; align-items: center; gap: 8px; }
.seg { display: flex; gap: 6px; }
.seg button { padding: 7px 13px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button.on-blue   { border-color: var(--blue);   color: var(--blue-ink); background: #f3f7ff; }
.seg button.on-amber  { border-color: var(--amber);  color: var(--amber);    background: #fffaf0; }
.search { position: relative; }
.search input { width: 172px; padding: 8px 12px 8px 32px; border-radius: 9px; border: 1.5px solid var(--border); font-size: 13px; background: var(--surface); color: var(--ink); }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,246,.12); }
.search .si { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 13px; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chk input { width: 16px; height: 16px; accent-color: var(--blue); }
.fb-spacer { flex: 1; }
.fb-count { font-size: 13px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); padding: 8px 14px; border-radius: 10px; }

/* ---------- Table ---------- */
.tablewrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th { background: var(--surface-2); text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
.tbl thead th .sort { margin-left: 5px; opacity: .45; font-size: 10px; }
.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .08s; }
.tbl tbody tr:hover { background: #f9fbff; }
.tbl tbody tr.warn { background: var(--yellow-row); }
.tbl tbody tr.warn:hover { background: #fff7df; }
.tbl tbody tr:last-child td { border-bottom: none; }
.cell-strong { font-weight: 700; color: var(--ink); }
.cell-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.cell-amount { font-weight: 800; color: var(--blue-ink); font-size: 14px; }
.cell-muted { color: var(--ink-3); }
.flag { display: inline-grid; place-items: center; width: 18px; height: 13px; border-radius: 2px; background: #dde3ee; color: var(--ink-2); font-size: 8px; font-weight: 800; margin-right: 6px; vertical-align: middle; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.b-slate  { background: var(--slate-bg);  color: var(--ink-2); }
.b-blue   { background: #e7eefe;          color: var(--blue-ink); }
.b-green  { background: var(--green-bg);  color: var(--green); }
.b-amber  { background: var(--amber-bg);  color: var(--amber); }
.b-orange { background: var(--orange-bg); color: var(--orange); }
.b-violet { background: #ede7fe;          color: #6d3fe0; }
.b-red    { background: var(--red-bg);    color: var(--red); }
.b-cyan   { background: var(--cyan-bg);   color: var(--cyan); }
.b-outline{ background: transparent; border: 1.5px solid var(--border); color: var(--ink-2); }
.b-ksef   { background: #efe9fe; color: #6d3fe0; }
.b-email  { background: var(--green-bg); color: var(--green); }
.b-manual { background: #e7eefe; color: var(--blue-ink); }
.badge-status { padding: 5px 12px; border-radius: 9px; font-size: 12px; }

/* status badge solid (jak referencja) */
.sbadge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 9px; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; }
.sb-slate  { background: #6b7384; }
.sb-blue   { background: var(--blue); }
.sb-green  { background: var(--green); }
.sb-amber  { background: var(--amber); }
.sb-orange { background: var(--orange); }
.sb-violet { background: #7c5cf6; }
.sb-red    { background: var(--red); }
.sb-cyan   { background: var(--cyan); }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,25,40,.45); backdrop-filter: blur(2px); z-index: 100; display: flex; justify-content: flex-end; }
.modal { background: var(--surface); width: 1040px; max-width: 96vw; height: 100vh; box-shadow: var(--sh-lg); display: flex; flex-direction: column; animation: slidein .22s cubic-bezier(.2,.8,.2,1); }
@keyframes slidein { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 14px; }
.modal-title { font-size: 19px; font-weight: 800; }
.modal-x { width: 34px; height: 34px; border-radius: 9px; border: none; background: var(--surface-2); color: var(--ink-2); font-size: 17px; display: grid; place-items: center; }
.modal-x:hover { background: #eceef3; }
.modal-tabs { display: flex; gap: 8px; padding: 0 24px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.mtab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 10px; background: var(--surface-2); border: none; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.mtab:hover { background: #eceef3; }
.mtab.active { background: var(--grad); color: #fff; box-shadow: var(--sh); }
.mtab .mt-badge { background: rgba(0,0,0,.12); padding: 0 7px; border-radius: 8px; font-size: 11px; font-weight: 800; }
.mtab.active .mt-badge { background: rgba(255,255,255,.28); }
.modal-body { flex: 1; overflow-y: auto; padding: 22px 24px; }
.modal-actions { border-top: 1px solid var(--border); padding: 16px 24px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.actions-row { display: flex; gap: 10px; }
.actions-row > * { flex: 1; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 11px; font-size: 14px; font-weight: 700; border: 1.5px solid transparent; width: 100%; }
.btn-grad { background: var(--grad); color: #fff; box-shadow: var(--sh); border: none; }
.btn-grad:hover { background: var(--grad-hover); }
.btn-out-blue { background: #f4f8ff; color: var(--blue-ink); border-color: #d7e4fe; }
.btn-out-blue:hover { background: #ecf3ff; }
.btn-out-green { background: #f1faf5; color: var(--green); border-color: #c8ecd9; }
.btn-out-orange { background: #fff8f1; color: var(--orange); border-color: #f6dcbf; }
.btn-out-red { background: #fef5f4; color: var(--red); border-color: #f6cfca; }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; }

/* detail sections inside modal */
.dsec { padding: 16px 0; border-bottom: 1px solid var(--border-2); }
.dsec:last-child { border-bottom: none; }
.dlabel { font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 7px; }
.dbig { font-size: 26px; font-weight: 800; letter-spacing: -.4px; }
.dsubcode { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.damount { font-size: 30px; font-weight: 800; color: var(--blue-ink); letter-spacing: -.5px; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.kv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 28px; }
.kv .k { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; }
.kv .v { font-size: 14px; font-weight: 600; margin-top: 3px; }
.kv .v small { color: var(--ink-3); font-weight: 500; }

/* timeline */
.timeline { position: relative; padding-left: 6px; }
.tl-item { position: relative; padding: 0 0 22px 30px; }
.tl-item::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -4px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.d-amber { background: var(--amber); } .d-green { background: var(--green); } .d-blue { background: var(--blue); }
.d-violet { background: #7c5cf6; } .d-orange { background: var(--orange); } .d-cyan { background: var(--cyan); } .d-red { background: var(--red); }
.tl-ts { font-size: 11.5px; color: var(--ink-3); }
.tl-title { font-weight: 700; font-size: 13.5px; margin-top: 1px; }
.tl-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }

/* generic cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.card-pad { padding: 18px; }
.grid { display: grid; gap: 16px; }
.empty { padding: 60px 20px; text-align: center; color: var(--ink-3); }

/* KPI */
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-sm); }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .k-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; }
.kpi .k-val { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.kpi .k-lbl { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.kpi .k-delta { font-size: 12px; font-weight: 700; }

/* density tweak */
:root[data-density="comfy"] .tbl tbody td { padding: 18px 18px; }
:root[data-density="comfy"] .tbl thead th { padding: 15px 18px; }
:root[data-density="comfy"] .stab { padding: 11px 16px; }

/* ---------- DataTable: sticky header + filter row ---------- */
.dt-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: visible; }
.dt-scroll { overflow-x: auto; border-radius: var(--r-lg); }
.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.dt thead th { background: var(--surface-2); text-align: left; font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.dt thead tr.head-row th { padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 110px; z-index: 18; background: var(--surface-2); cursor: pointer; user-select: none; }
.dt thead tr.head-row th:hover { background: #eef0f4; color: var(--ink-2); }
.dt thead tr.head-row th .sort-ico { margin-left: 5px; font-size: 10px; }
.dt thead tr.head-row th.sorted { color: var(--blue-ink); }
.dt thead tr.filter-row th { padding: 7px 10px; border-bottom: 1px solid var(--border); position: sticky; top: 152px; z-index: 17; background: var(--surface); }
.dt tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.dt tbody tr { cursor: pointer; transition: background .08s; }
.dt tbody tr:hover { background: #f9fbff; }
.dt tbody tr.warn { background: var(--yellow-row); }
.dt tbody tr.warn:hover { background: #fff7df; }
:root[data-density="comfy"] .dt tbody td { padding: 18px 16px; }

/* filter cell */
.fcell { display: flex; align-items: stretch; gap: 0; border: 1.5px solid var(--border); border-radius: 9px; background: var(--surface); position: relative; height: 34px; transition: border-color .12s, box-shadow .12s; }
.fcell:hover { border-color: #d4d9e3; }
.fcell:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,246,.12); }
.fcell.has-val { border-color: var(--blue); background: #f4f8ff; box-shadow: inset 0 0 0 1px rgba(47,107,246,.18); }
.fop { flex-shrink: 0; padding: 0 8px; font-size: 12px; font-weight: 800; color: var(--ink-3); border-right: 1.5px solid var(--border); background: transparent; line-height: 1; border-radius: 7px 0 0 7px; display: grid; place-items: center; min-width: 30px; }
.fop:hover { background: var(--surface-2); color: var(--blue-ink); }
.fcell.has-val .fop { color: var(--blue-ink); border-color: rgba(47,107,246,.2); }
.fcell input { border: none; background: transparent; padding: 0 8px; font-size: 12.5px; width: 100%; min-width: 50px; color: var(--ink); font-family: inherit; }
.fcell input:focus { outline: none; }
.fcell input::placeholder { color: var(--ink-3); }
.fcaret { flex-shrink: 0; padding: 0 8px; color: var(--ink-3); font-size: 10px; background: transparent; border: none; border-left: 1.5px solid var(--border); display: grid; place-items: center; }
.fcaret:hover { background: var(--surface-2); color: var(--blue-ink); }
.fcaret.on { color: var(--blue-ink); }
.fchips { display: flex; align-items: center; gap: 4px; padding: 0 6px; flex: 1; min-width: 0; overflow: hidden; }
.fchip { font-size: 11px; font-weight: 700; color: var(--blue-ink); white-space: nowrap; }
.fclear { flex-shrink: 0; padding: 0 7px; color: var(--ink-3); font-size: 13px; background: none; border: none; }
.fclear:hover { color: var(--red); }
.fmenu { position: absolute; top: calc(100% + 5px); left: 0; z-index: 70; background: #fff; border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--sh-md); padding: 5px; min-width: 178px; }
.fmenu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 10px; border-radius: 7px; border: none; background: none; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.fmenu button:hover { background: var(--surface-2); }
.fmenu button.sel { background: #eef3fe; color: var(--blue-ink); }
.fmenu .fglyph { width: 20px; color: var(--ink-3); font-weight: 800; text-align: center; }

/* Excel-style value picker popover */
.fvalues { position: absolute; top: calc(100% + 5px); right: 0; z-index: 70; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh-lg); width: 244px; overflow: hidden; }
.fv-head { padding: 9px 11px; border-bottom: 1px solid var(--border-2); }
.fv-search { position: relative; }
.fv-search input { width: 100%; padding: 7px 10px 7px 28px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 12.5px; font-family: inherit; }
.fv-search input:focus { outline: none; border-color: var(--blue); }
.fv-search .si { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--ink-3); }
.fv-actions { display: flex; gap: 8px; padding: 7px 11px; border-bottom: 1px solid var(--border-2); }
.fv-actions button { font-size: 11.5px; font-weight: 700; color: var(--blue-ink); background: none; border: none; padding: 2px 4px; border-radius: 6px; }
.fv-actions button:hover { text-decoration: underline; }
.fv-actions .sep { color: var(--border); }
.fv-list { max-height: 230px; overflow-y: auto; padding: 5px; }
.fv-opt { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 12.5px; color: var(--ink); }
.fv-opt:hover { background: var(--surface-2); }
.fv-opt input { width: 15px; height: 15px; accent-color: var(--blue); flex-shrink: 0; }
.fv-opt .fv-lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv-opt .fv-cnt { font-size: 11px; color: var(--ink-3); font-weight: 700; background: var(--surface-2); padding: 1px 6px; border-radius: 8px; }
.fv-foot { display: flex; gap: 8px; padding: 9px 11px; border-top: 1px solid var(--border-2); }
.fv-foot button { flex: 1; padding: 8px; border-radius: 8px; font-size: 12.5px; font-weight: 700; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink-2); }
.fv-foot button.primary { background: var(--grad); color: #fff; border: none; }

/* active filter pills */
.filterpills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.fpill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 6px 5px 11px; border-radius: 9px; background: #eef3fe; border: 1px solid #d7e4fe; color: var(--blue-ink); font-size: 12.5px; font-weight: 600; }
.fpill .fp-col { font-weight: 800; }
.fpill .fp-op { color: var(--ink-3); font-weight: 600; }
.fpill .fp-x { width: 18px; height: 18px; border-radius: 6px; border: none; background: rgba(47,107,246,.12); color: var(--blue-ink); font-size: 12px; display: grid; place-items: center; }
.fpill .fp-x:hover { background: var(--red); color: #fff; }
.fpills-clear { font-size: 12.5px; font-weight: 700; color: var(--ink-3); background: none; border: none; padding: 5px 8px; border-radius: 8px; }
.fpills-clear:hover { color: var(--red); background: var(--red-bg); }

/* pagination */
.dt-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); gap: 14px; flex-wrap: wrap; }
.dt-foot .pg-info { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.pg { display: flex; align-items: center; gap: 4px; }
.pg button { min-width: 32px; height: 32px; padding: 0 9px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pg button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue-ink); }
.pg button.active { background: var(--grad); color: #fff; border-color: transparent; }
.pg button:disabled { opacity: .4; cursor: default; }
.pg-size { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.pg-size select { padding: 5px 8px; border-radius: 8px; border: 1.5px solid var(--border); font-size: 12.5px; font-family: inherit; background: var(--surface); color: var(--ink); }

/* skeleton */
@keyframes shimmer { 0% { background-position: -360px 0; } 100% { background-position: 360px 0; } }
.skel { display: inline-block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef0f4 25%, #e2e6ee 37%, #eef0f4 63%); background-size: 720px 100%; animation: shimmer 1.25s infinite linear; }

/* ---------- Real map (Leaflet) ---------- */
.real-map { width: 100%; border-radius: 0 0 14px 14px; overflow: hidden; z-index: 1; }
.leaflet-container { font-family: var(--font); background: #eaf0f8; }
.leaflet-tooltip { border: none; box-shadow: var(--sh); border-radius: 8px; font-size: 12px; padding: 5px 9px; }
.veh-icon { background: none; border: none; }
.veh-dot { position: relative; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2.5px solid var(--vc); display: grid; place-items: center; font-size: 15px; box-shadow: 0 3px 10px rgba(20,25,40,.28); }
.veh-pulse { position: absolute; inset: -2px; border-radius: 50%; opacity: .45; animation: pulse 1.8s infinite ease-out; }
.veh-name { position: absolute; top: 31px; left: 50%; transform: translateX(-50%); background: var(--vc, #1f2430); color: #fff; font-size: 9.5px; font-weight: 800; padding: 1px 6px; border-radius: 6px; white-space: nowrap; box-shadow: var(--sh-sm); }
.veh-dot.veh-static { background: #fff; }
.veh-bul { width: 13px; height: 13px; border-radius: 50%; display: block; border: 2px solid #fff; }

/* ---------- Pulpit — odświeżony, nowoczesny ---------- */
.sd-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; border-radius: 18px; margin-bottom: 16px; color: #fff; background: linear-gradient(115deg, #2f4fd8 0%, #6b46e0 55%, #8b5cf6 100%); position: relative; overflow: hidden; box-shadow: 0 14px 40px rgba(75,70,180,.28); }
.sd-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.10); }
.sd-hero::before { content: ""; position: absolute; right: 120px; bottom: -90px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.07); }
.sd-hero .h-greet { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.sd-hero .h-sub { opacity: .9; font-size: 13.5px; margin-top: 3px; }
.sd-hero .h-clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.sd-hero .h-stats { display: flex; gap: 22px; position: relative; z-index: 2; }
.sd-hero .h-stat { text-align: center; }
.sd-hero .h-stat b { font-size: 24px; font-weight: 800; display: block; }
.sd-hero .h-stat span { font-size: 11.5px; opacity: .85; }
.sd-hero .h-cta { background: #fff; color: var(--blue-ink); border: none; border-radius: 11px; padding: 11px 18px; font-weight: 800; font-size: 13.5px; position: relative; z-index: 2; box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.sd-kpi { transition: transform .15s, box-shadow .15s; border-radius: 16px; }
.sd-map-hero { grid-column: 1 / -1; }
.sd-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--green); }
.sd-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(16,163,106,.5); animation: livedot 1.6s infinite; }
@keyframes livedot { 0% { box-shadow: 0 0 0 0 rgba(16,163,106,.45); } 100% { box-shadow: 0 0 0 8px rgba(16,163,106,0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sd > * { opacity: 1; }
.sd-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.sd-kpi { transition: transform .15s, box-shadow .15s; }
.sd-kpi:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.sd-kpi .k-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.sd-spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.sd-spark span { width: 6px; border-radius: 3px; display: block; transition: height .3s; }
.sd-row2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin-bottom: 16px; }
.sd-row3 { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.sd-card-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border-2); }

/* mapa */
.sd-map { overflow: hidden; display: flex; flex-direction: column; }
.sd-legend { display: flex; gap: 12px; font-size: 11.5px; color: var(--ink-2); font-weight: 600; flex-wrap: wrap; }
.sd-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.sd-map-body { position: relative; flex: 1; min-height: 330px; background: linear-gradient(160deg, #f3f6fb, #eaf0f8); overflow: hidden; }
.sd-map-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(47,107,246,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(47,107,246,.06) 1px, transparent 1px); background-size: 34px 34px; }
.sd-poland { position: absolute; left: 22%; top: 8%; width: 56%; height: 84%; background: radial-gradient(ellipse at center, rgba(47,107,246,.10), rgba(47,107,246,.03) 70%, transparent); border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%; border: 1.5px dashed rgba(47,107,246,.22); }
.map-pin { position: absolute; transform: translate(-50%, -50%); cursor: pointer; }
.map-pin .map-dot { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: var(--sh-sm); position: relative; z-index: 2; }
.map-pin .map-pulse { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); opacity: .5; animation: pulse 1.8s infinite ease-out; }
@keyframes pulse { 0% { transform: translate(-50%, -50%) scale(1); opacity: .5; } 100% { transform: translate(-50%, -50%) scale(3.4); opacity: 0; } }
.map-pin.due .map-dot, .map-pin.due { width: 9px; height: 9px; background: #c2cad8; border-radius: 50%; border: 2px solid #fff; }
.map-pin .map-tip { position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: #1f2430; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 11px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5; line-height: 1.35; }
.map-pin:hover .map-tip { opacity: 1; }
.sd-map-foot { display: flex; gap: 22px; padding: 12px 18px; border-top: 1px solid var(--border-2); font-size: 12.5px; color: var(--ink-2); }
.sd-map-foot b { color: var(--ink); }

/* maile */
.sd-mails { display: flex; flex-direction: column; }
.sd-mail-list { padding: 6px; overflow-y: auto; }
.sd-mail { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 10px; cursor: pointer; transition: background .1s; }
.sd-mail:hover { background: var(--surface-2); }
.sd-mail-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex-shrink: 0; }
.sd-mail-dot.unread { background: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,246,.16); }

/* oferty / ekipy */
.sd-offer { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; background: var(--surface-2); cursor: pointer; transition: transform .1s; }
.sd-offer:hover { transform: translateX(3px); }
.sd-jobchip { border: 1.5px solid var(--border); background: #fff; border-radius: 8px; padding: 5px 9px; font-size: 11.5px; color: var(--ink-2); }
.sd-jobchip:hover { border-color: var(--blue); color: var(--blue-ink); }
.sd-jobchip b { color: var(--ink); }

/* SafeMail convert cards */
.convert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.convert-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); text-align: left; transition: transform .12s, border-color .12s, box-shadow .12s; }
.convert-card:hover { transform: translateY(-2px); border-color: var(--blue); box-shadow: var(--sh); }
.convert-card .cc-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; margin-bottom: 6px; }
.convert-card .cc-t { font-weight: 800; font-size: 14px; }
.convert-card .cc-s { font-size: 11.5px; color: var(--ink-3); font-weight: 600; font-family: ui-monospace, Menlo, monospace; }

/* compose */
.compose { position: fixed; right: 24px; bottom: 24px; width: 460px; max-width: 94vw; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--sh-lg); z-index: 120; overflow: hidden; animation: fadeUp .22s both; }
.compose-head { background: var(--grad); color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.compose-head button { background: rgba(255,255,255,.2); border: none; color: #fff; width: 28px; height: 28px; border-radius: 8px; }
.compose-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.compose-body label { font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; }
.compose-body input, .compose-body textarea, .compose-body select { width: 100%; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 13px; font-family: inherit; }
.compose-body input:focus, .compose-body textarea:focus { outline: none; border-color: var(--blue); }
.compose-foot { display: flex; gap: 10px; padding: 0 16px 16px; }

/* ---------- Offer Builder ---------- */
.ob-overlay { position: fixed; inset: 0; background: rgba(20,25,40,.5); backdrop-filter: blur(2px); z-index: 110; display: grid; place-items: center; padding: 18px; }
.ob { background: var(--surface); width: 1500px; max-width: 98vw; height: 94vh; border-radius: 16px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden; }
.ob-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.ob-body { flex: 1; display: grid; grid-template-columns: 268px 1fr 430px; overflow: hidden; }
.ob-col { overflow-y: auto; }
.ob-col-head { padding: 12px; font-weight: 800; font-size: 12.5px; border-bottom: 1px solid var(--border-2); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.ob-devices { background: var(--surface-2); border-right: 1px solid var(--border); }
.ob-dev { padding: 11px 12px; border-bottom: 1px solid var(--border-2); cursor: pointer; }
.ob-dev:hover { background: #fff; }
.ob-dev.active { background: #eef3fe; border-left: 3px solid var(--blue); padding-left: 9px; }
.ob-editor { border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.ob-dev-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.ob-group { padding: 4px 0; }
.ob-group-head { padding: 7px 16px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.ob-group-head.g-robocizna { background: #eef3fe; color: var(--blue-ink); }
.ob-group-head.g-materialy { background: #eafaf1; color: var(--green); }
.ob-group-head.g-uslugi { background: #f5f0ff; color: #6d3fe0; }
.ob-item { display: flex; align-items: center; gap: 8px; padding: 7px 16px; border-bottom: 1px solid #f3f4f6; }
.ob-item:hover { background: var(--surface-2); }
.ob-name { border: 1.5px solid transparent; border-radius: 6px; padding: 4px 6px; font-size: 13px; font-family: inherit; width: 100%; background: transparent; font-weight: 600; }
.ob-name:hover { border-color: var(--border); background: #fff; }
.ob-name:focus { outline: none; border-color: var(--blue); background: #fff; }
.ob-unit { font-size: 12px; color: var(--ink-3); width: 30px; }
.ob-total { font-weight: 800; font-size: 13px; width: 92px; text-align: right; color: var(--blue-ink); }
.ob-x { border: none; background: none; color: var(--ink-3); font-size: 12px; width: 22px; height: 22px; border-radius: 6px; }
.ob-x:hover { background: var(--red-bg); color: var(--red); }
.ob-add { margin: 4px 16px 8px; font-size: 12px; color: var(--blue-ink); background: none; border: 1.5px dashed var(--border); border-radius: 8px; padding: 6px 10px; font-weight: 700; }
.ob-add:hover { border-color: var(--blue); background: #f6f9ff; }
.ob-services { padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface-2); margin-top: auto; }
.ob-srv { font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: #fff; border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.ob-srv:hover { border-color: var(--blue); color: var(--blue-ink); }
.ob-srv.ai { background: var(--grad); color: #fff; border: none; }
.ob-preview { background: #f1f3f7; padding: 18px; }
.pdf { background: #fff; border-radius: 10px; box-shadow: var(--sh); padding: 22px; font-size: 12px; }
.pdf-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.pdf-dev { margin-top: 14px; padding: 12px; background: var(--surface-2); border-radius: 9px; }
.pdf-tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11px; }
.pdf-tbl th { text-align: left; padding: 6px 6px; border-bottom: 1.5px solid var(--border); font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); }
.pdf-tbl td { padding: 6px 6px; border-bottom: 1px solid var(--border-2); vertical-align: top; }
.pdf-totals { margin-top: 12px; margin-left: auto; width: 220px; }
.pdf-totals div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.pdf-totals .grand { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 8px; font-size: 15px; }
.pdf-totals .grand b { color: var(--blue-ink); }
.ob-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--border); gap: 16px; }
.ob-foot-totals { display: flex; gap: 28px; align-items: center; }

/* ---------- Panel Stack (drill-down kolumnowy) ---------- */
.stage { transition: transform .32s cubic-bezier(.22,.7,.25,1), filter .32s; transform-origin: left center; }
.stage.pushed { transform: translateX(calc(-1 * var(--push, 0px))); filter: brightness(.985); }
.panel-scrim { position: fixed; inset: 0; background: rgba(20,25,40,.34); backdrop-filter: blur(1.5px); z-index: 190; animation: scrimIn .25s both; }
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
.panel { position: fixed; top: 0; bottom: 0; background: transparent; transition: left .32s cubic-bezier(.22,.7,.25,1); animation: panelIn .34s cubic-bezier(.22,.7,.25,1) both; }
@keyframes panelIn { from { transform: translateX(46px); opacity: .2; } to { transform: none; opacity: 1; } }
.panel-inner { position: absolute; inset: 0; background: var(--surface); box-shadow: -18px 0 50px rgba(20,25,40,.20); border-left: 1px solid var(--border); overflow: hidden; }
.panel.covered .panel-inner { filter: brightness(.92) saturate(.9); }
.panel.covered .panel-inner::after { content: ""; position: absolute; inset: 0; background: rgba(20,25,40,.10); z-index: 50; }
.panel-spine { position: absolute; top: 0; bottom: 0; left: 0; z-index: 60; background: linear-gradient(180deg, #fbfcfe, #f1f3f8); border: none; border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 16px 0; cursor: pointer; }
.panel-spine:hover { background: linear-gradient(180deg, #eef3fe, #e7eefe); }
.panel-spine-txt { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; font-weight: 800; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 70%; letter-spacing: .3px; }
.panel-spine-ico { font-size: 20px; color: var(--blue-ink); font-weight: 800; line-height: 1; }
.panel-spine:hover .panel-spine-txt { color: var(--blue-ink); }

/* karta treści panelu (zastępuje dawny .modal) */
.pcard { height: 100%; display: flex; flex-direction: column; background: var(--surface); }

/* AI box */
.ai-box { border: 1.5px solid #e2e8fe; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg,#f5f8ff,#f8f5ff); }
.ai-head { display: flex; align-items: center; gap: 9px; padding: 11px 13px; }
.ai-spark { font-size: 16px; }
.ai-title { font-weight: 800; font-size: 13px; }
.ai-tag { font-size: 10px; font-weight: 800; color: #6d3fe0; background: #ede7fe; padding: 2px 7px; border-radius: 7px; text-transform: uppercase; letter-spacing: .5px; }
.ai-run { margin-left: auto; background: var(--grad); color: #fff; border: none; border-radius: 9px; padding: 7px 13px; font-size: 12.5px; font-weight: 700; }
.ai-run:disabled { opacity: .6; }
.ai-hint { padding: 0 13px 13px; font-size: 12.5px; color: var(--ink-3); }
.ai-body { padding: 0 13px 13px; }
.ai-result { font-size: 13px; color: var(--ink); line-height: 1.5; background: #fff; margin: 0 10px 10px; padding: 12px; border-radius: 9px; border: 1px solid var(--border); }
.ai-actions { display: flex; gap: 8px; margin-top: 8px; }
.ai-actions .btn { width: auto; }

/* Planer kierownika */
.planer { display: grid; grid-template-columns: 350px 1fr 330px; gap: 16px; align-items: start; }
.planer-list, .planer-map, .planer-days { display: flex; flex-direction: column; }
.planer-jobs { overflow-y: auto; max-height: 600px; padding: 8px; }
.planer-job { display: flex; gap: 10px; padding: 10px; border-radius: 10px; border: 1px solid var(--border-2); margin-bottom: 7px; }
.planer-job:hover { background: var(--surface-2); }
.planer-job.hl { background: #eef3fe; border-color: #cfe0fe; }
.planer-job > div:first-child { cursor: pointer; }
.planer-assign { display: flex; gap: 4px; margin-top: 7px; justify-content: flex-end; }
.planer-assign button { width: 23px; height: 23px; border-radius: 7px; border: none; color: #fff; font-size: 11px; font-weight: 800; }
.planer-assign button:hover { transform: scale(1.12); }
.map-pin.hl { z-index: 8; }
.planer-days-body { overflow-y: auto; max-height: 600px; }
.planer-day { border-bottom: 1px solid var(--border-2); padding: 11px 13px; }
.planer-day-head { font-weight: 800; font-size: 12.5px; }
.planer-chip { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px; margin-top: 5px; font-size: 11.5px; }
.planer-chip > span { cursor: pointer; }
.planer-chip button { border: none; background: none; color: var(--ink-3); font-size: 12px; }
.planer-chip button:hover { color: var(--red); }

/* ---------- Komunikator ---------- */
.overlay-r { position: fixed; inset: 0; background: rgba(20,25,40,.42); z-index: 300; display: flex; justify-content: flex-end; }
.msgr { background: #fff; width: 880px; max-width: 96vw; height: 100vh; display: flex; flex-direction: column; box-shadow: var(--sh-lg); animation: slidein .22s cubic-bezier(.2,.8,.2,1); }
@keyframes slidein { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.msgr-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.msgr-body { flex: 1; display: grid; grid-template-columns: 300px 1fr; overflow: hidden; }
.msgr-list { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface-2); }
.msgr-thread { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border-2); cursor: pointer; }
.msgr-thread:hover { background: #fff; }
.msgr-thread.active { background: #eef3fe; box-shadow: inset 3px 0 0 var(--blue); }
.msgr-avs { display: flex; }
.msgr-unread { background: var(--red); color: #fff; font-size: 10px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
.msgr-conv { display: flex; flex-direction: column; overflow: hidden; }
.msgr-conv-head { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.msgr-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(180deg,#fbfcfe,#f6f8fb); }
.msgr-msg { display: flex; gap: 10px; max-width: 80%; }
.msgr-msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msgr-bubble { background: #fff; border: 1px solid var(--border); padding: 10px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; box-shadow: var(--sh-sm); }
.msgr-msg.mine .msgr-bubble { background: var(--grad); color: #fff; border: none; }
.msgr-composer { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); align-items: center; }
.msgr-composer input { flex: 1; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 11px; font-size: 13.5px; font-family: inherit; }
.msgr-composer input:focus { outline: none; border-color: var(--blue); }
.msgr-send { width: 44px; height: 44px; border-radius: 11px; border: none; background: var(--grad); color: #fff; font-size: 17px; }
.msgr-attach { width: 42px; height: 42px; border-radius: 11px; border: 1.5px solid var(--border); background: #fff; font-size: 17px; flex-shrink: 0; }
.msgr-attach:hover { border-color: var(--blue); }
.msgr-pending { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 18px 12px; }
.msgr-pchip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; font-size: 12px; }
.msgr-pchip button { border: none; background: none; color: var(--ink-3); font-size: 11px; }
.msgr-atts { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }
.att-img { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); max-width: 220px; background: #fff; }
.att-img img { display: block; width: 100%; max-height: 200px; object-fit: cover; }
.att-img .att-name { display: block; padding: 5px 9px; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-file { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; min-width: 220px; }
.att-file.mine { background: rgba(255,255,255,.92); }
.att-ico { font-size: 22px; }
.att-fname { font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-fsize { font-size: 11px; color: var(--ink-3); }
.att-dl { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface-2); color: var(--blue-ink); display: grid; place-items: center; text-decoration: none; font-size: 14px; flex-shrink: 0; }
.att-dl:hover { border-color: var(--blue); }

/* kadry */
.kadry-chip { border: 1.5px solid var(--border); background: #fff; border-radius: 20px; padding: 7px 14px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.kadry-chip.on { color: #fff; border-color: transparent; }
.kr-tbl { border-collapse: collapse; font-size: 11px; width: 100%; }
.kr-tbl th, .kr-tbl td { border: 1px solid var(--border-2); padding: 5px 4px; text-align: center; min-width: 30px; }
.kr-tbl .kr-side { text-align: left; font-weight: 700; white-space: nowrap; position: sticky; left: 0; background: #fff; min-width: 150px; padding-left: 10px; }
.kr-tbl thead th { background: var(--surface-2); font-weight: 800; }
.kr-wknd { background: #fef2f2; color: var(--red); }
.kr-tbl .kr-sum { font-weight: 800; background: var(--surface-2); }
.kr-plan td { background: #eef3fe; }
.kr-otd td { background: #fffbeb; }
.kr-otc td { background: #ecfdf5; color: var(--green); font-weight: 700; }
.kr-foot { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--border-2); border-top: 1px solid var(--border); }
.kr-foot > div { background: #fff; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.kr-foot b { font-size: 18px; }

/* brygady */
.crew-member { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border); background: #fff; border-radius: 9px; padding: 5px 9px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.crew-member.on { border-color: var(--blue); background: #eef3fe; color: var(--blue-ink); }

/* trasy planer */
.route-row { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 10px; padding: 11px 13px; }
.route-opt { border: 1.5px solid var(--border); background: #fff; border-radius: 8px; padding: 5px 9px; font-size: 10.5px; color: var(--ink-3); font-weight: 600; line-height: 1.3; text-align: center; }
.route-opt b { color: var(--ink); font-size: 11px; }
.route-opt.on { border-color: var(--blue); background: #eef3fe; color: var(--blue-ink); }
.route-opt.on b { color: var(--blue-ink); }

/* recipient picker */
.rcp { position: relative; margin-top: 6px; }
.rcp-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border: 1.5px solid var(--border); border-radius: 11px; padding: 9px 11px; min-height: 46px; cursor: pointer; }
.rcp-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef3fe; color: var(--blue-ink); border-radius: 8px; padding: 3px 6px 3px 4px; font-size: 12.5px; font-weight: 600; }
.rcp-chip button { border: none; background: none; color: var(--blue-ink); font-size: 11px; }
.rcp-caret { margin-left: auto; color: var(--ink-3); }
.rcp-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh-md); padding: 6px; z-index: 10; max-height: 280px; overflow-y: auto; }
.rcp-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.rcp-opt:hover { background: var(--surface-2); }
.rcp-opt input { width: 16px; height: 16px; accent-color: var(--blue); }

/* ---------- Powiadomienia ---------- */
.notif-pop { position: fixed; top: 58px; right: 96px; width: 380px; max-width: 92vw; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--sh-lg); z-index: 300; overflow: hidden; animation: fadeUp .2s both; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--border-2); }
.notif-push { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: linear-gradient(135deg,#f3f7ff,#f8f5ff); border-bottom: 1px solid var(--border-2); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--border-2); cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: #f6f9ff; }
.notif-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; }

/* ---------- Admin ---------- */
.adm-inp { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 13.5px; font-family: inherit; }
.adm-inp:focus { outline: none; border-color: var(--blue); }
.adm-roles { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-role { background: none; border: 1.5px solid transparent; border-radius: 10px; padding: 3px; }
.adm-role.on { border-color: var(--blue); background: #f3f7ff; }

/* ---------- Protokół na tablecie ---------- */
.ppad-overlay { position: fixed; inset: 0; background: rgba(20,25,40,.55); z-index: 320; display: grid; place-items: center; padding: 16px; }
.ppad { background: #eef0f4; width: 1100px; max-width: 98vw; height: 96vh; border-radius: 16px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden; }
.ppad-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--border); }
.ppad-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--border); }
.ppad-tools { display: flex; align-items: center; gap: 7px; }
.ppad-tools button { border: 1.5px solid var(--border); background: #fff; border-radius: 9px; padding: 7px 12px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.ppad-tools button.on { border-color: var(--blue); color: var(--blue-ink); background: #f3f7ff; }
.ppad-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); padding: 0; }
.ppad-color.on { box-shadow: 0 0 0 2px var(--blue); }
.ppad-scroll { flex: 1; overflow-y: auto; padding: 22px; display: flex; justify-content: center; }
.ppad-doc { position: relative; width: 800px; max-width: 100%; }
.pdoc { background: #fff; border-radius: 6px; box-shadow: var(--sh-md); padding: 34px 38px; min-height: 1000px; font-size: 13px; }
.pdoc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 20px; margin: 16px 0; }
.pdoc-section { font-weight: 800; text-transform: uppercase; letter-spacing: .5px; font-size: 12px; color: var(--ink-3); margin: 18px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.pdoc-check { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.pdoc-box { width: 18px; height: 18px; border: 1.5px solid #1f2430; border-radius: 3px; flex-shrink: 0; }
.pdoc-notes { height: 90px; border: 1px dashed var(--border); border-radius: 6px; }
.pdoc-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.pdoc-sigline { border-bottom: 1.5px solid #1f2430; height: 60px; }
.ppad-canvas { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.ppad-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: #fff; border-top: 1px solid var(--border); }

/* protokoły — wzory z polami */
.proto-doc { background: #fff; border-radius: 8px; box-shadow: var(--sh-md); padding: 28px 32px; width: 820px; max-width: 100%; }
.proto-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; padding-bottom: 14px; border-bottom: 2px solid #1f2430; margin-bottom: 16px; font-size: 13px; }
.proto-section { margin-bottom: 18px; }
.proto-section-title { font-weight: 800; text-transform: uppercase; letter-spacing: .5px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--border); padding-bottom: 5px; margin-bottom: 10px; }
.proto-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.proto-check { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; user-select: none; }
.proto-check:hover { background: var(--surface-2); }
.proto-check.on { border-color: var(--green); background: #f1faf5; color: var(--green); }
.proto-box { width: 22px; height: 22px; border: 1.5px solid var(--ink-3); border-radius: 5px; display: grid; place-items: center; font-weight: 800; color: var(--green); flex-shrink: 0; }
.proto-check.on .proto-box { border-color: var(--green); background: #fff; }
.proto-field, .proto-full { display: flex; flex-direction: column; }
.proto-full { grid-column: 1 / -1; }
.proto-input { padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 13px; font-family: inherit; }
.proto-input:focus { outline: none; border-color: var(--blue); }
.proto-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.sig-wrap { display: flex; flex-direction: column; }
.sig-canvas { border: 1.5px dashed var(--border); border-radius: 9px; height: 110px; touch-action: none; cursor: crosshair; background: #fff; }
.proto-pick { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px solid var(--border); border-radius: 12px; background: #fff; text-align: left; }
.proto-pick:hover { border-color: var(--blue); box-shadow: var(--sh); transform: translateY(-2px); transition: all .12s; }

/* ---------- Drzewo plików ---------- */
.ftree { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ftree-row { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border-2); }
.ftree-row:hover { background: var(--surface-2); }
.ftree-row.top { font-weight: 800; background: var(--surface-2); }
.ftree-caret { width: 14px; color: var(--ink-3); font-size: 11px; }
.ftree-sub .ftree-row { padding-left: 30px; font-weight: 600; }
.ftree-file { display: flex; align-items: center; gap: 9px; padding: 7px 14px 7px 46px; border-bottom: 1px solid var(--border-2); }
.ftree-file:hover { background: #f9fbff; }

/* ---------- Ryzyka ---------- */
.risk-row { background: var(--surface-2); border-radius: 10px; padding: 11px 13px; }

/* density tweak */
:root[data-density="comfy"] .tbl tbody td { padding: 18px 18px; }
:root[data-density="comfy"] .tbl thead th { padding: 15px 18px; }
:root[data-density="comfy"] .stab { padding: 11px 16px; }

/* === dashboard_append.css === */

/* ====== DOKLEJKA: zaawansowane style z prototypu (dashboard/mapa/planer/komunikator/oferty/panele) ====== */

/* ---------- Real map (Leaflet) ---------- */
.real-map { width: 100%; border-radius: 0 0 14px 14px; overflow: hidden; z-index: 1; }
.leaflet-container { font-family: var(--font); background: #eaf0f8; }
.leaflet-tooltip { border: none; box-shadow: var(--sh); border-radius: 8px; font-size: 12px; padding: 5px 9px; }
.veh-icon { background: none; border: none; }
.veh-dot { position: relative; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2.5px solid var(--vc); display: grid; place-items: center; font-size: 15px; box-shadow: 0 3px 10px rgba(20,25,40,.28); }
.veh-pulse { position: absolute; inset: -2px; border-radius: 50%; opacity: .45; animation: pulse 1.8s infinite ease-out; }
.veh-name { position: absolute; top: 31px; left: 50%; transform: translateX(-50%); background: var(--vc, #1f2430); color: #fff; font-size: 9.5px; font-weight: 800; padding: 1px 6px; border-radius: 6px; white-space: nowrap; box-shadow: var(--sh-sm); }
.veh-dot.veh-static { background: #fff; }
.veh-bul { width: 13px; height: 13px; border-radius: 50%; display: block; border: 2px solid #fff; }

/* ---------- Pulpit — odświeżony, nowoczesny ---------- */
.sd-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; border-radius: 18px; margin-bottom: 16px; color: #fff; background: linear-gradient(115deg, #2f4fd8 0%, #6b46e0 55%, #8b5cf6 100%); position: relative; overflow: hidden; box-shadow: 0 14px 40px rgba(75,70,180,.28); }
.sd-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.10); }
.sd-hero::before { content: ""; position: absolute; right: 120px; bottom: -90px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.07); }
.sd-hero .h-greet { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.sd-hero .h-sub { opacity: .9; font-size: 13.5px; margin-top: 3px; }
.sd-hero .h-clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.sd-hero .h-stats { display: flex; gap: 22px; position: relative; z-index: 2; }
.sd-hero .h-stat { text-align: center; }
.sd-hero .h-stat b { font-size: 24px; font-weight: 800; display: block; }
.sd-hero .h-stat span { font-size: 11.5px; opacity: .85; }
.sd-hero .h-cta { background: #fff; color: var(--blue-ink); border: none; border-radius: 11px; padding: 11px 18px; font-weight: 800; font-size: 13.5px; position: relative; z-index: 2; box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.sd-kpi { transition: transform .15s, box-shadow .15s; border-radius: 16px; }
.sd-map-hero { grid-column: 1 / -1; }
.sd-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--green); }
.sd-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(16,163,106,.5); animation: livedot 1.6s infinite; }
@keyframes livedot { 0% { box-shadow: 0 0 0 0 rgba(16,163,106,.45); } 100% { box-shadow: 0 0 0 8px rgba(16,163,106,0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sd > * { opacity: 1; }
.sd-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.sd-kpi { transition: transform .15s, box-shadow .15s; }
.sd-kpi:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.sd-kpi .k-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.sd-spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.sd-spark span { width: 6px; border-radius: 3px; display: block; transition: height .3s; }
.sd-row2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin-bottom: 16px; }
.sd-row3 { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.sd-card-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border-2); }

/* mapa */
.sd-map { overflow: hidden; display: flex; flex-direction: column; }
.sd-legend { display: flex; gap: 12px; font-size: 11.5px; color: var(--ink-2); font-weight: 600; flex-wrap: wrap; }
.sd-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.sd-map-body { position: relative; flex: 1; min-height: 330px; background: linear-gradient(160deg, #f3f6fb, #eaf0f8); overflow: hidden; }
.sd-map-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(47,107,246,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(47,107,246,.06) 1px, transparent 1px); background-size: 34px 34px; }
.sd-poland { position: absolute; left: 22%; top: 8%; width: 56%; height: 84%; background: radial-gradient(ellipse at center, rgba(47,107,246,.10), rgba(47,107,246,.03) 70%, transparent); border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%; border: 1.5px dashed rgba(47,107,246,.22); }
.map-pin { position: absolute; transform: translate(-50%, -50%); cursor: pointer; }
.map-pin .map-dot { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: var(--sh-sm); position: relative; z-index: 2; }
.map-pin .map-pulse { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); opacity: .5; animation: pulse 1.8s infinite ease-out; }
@keyframes pulse { 0% { transform: translate(-50%, -50%) scale(1); opacity: .5; } 100% { transform: translate(-50%, -50%) scale(3.4); opacity: 0; } }
.map-pin.due .map-dot, .map-pin.due { width: 9px; height: 9px; background: #c2cad8; border-radius: 50%; border: 2px solid #fff; }
.map-pin .map-tip { position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: #1f2430; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 11px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5; line-height: 1.35; }
.map-pin:hover .map-tip { opacity: 1; }
.sd-map-foot { display: flex; gap: 22px; padding: 12px 18px; border-top: 1px solid var(--border-2); font-size: 12.5px; color: var(--ink-2); }
.sd-map-foot b { color: var(--ink); }

/* maile */
.sd-mails { display: flex; flex-direction: column; }
.sd-mail-list { padding: 6px; overflow-y: auto; }
.sd-mail { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 10px; cursor: pointer; transition: background .1s; }
.sd-mail:hover { background: var(--surface-2); }
.sd-mail-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex-shrink: 0; }
.sd-mail-dot.unread { background: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,246,.16); }

/* oferty / ekipy */
.sd-offer { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; background: var(--surface-2); cursor: pointer; transition: transform .1s; }
.sd-offer:hover { transform: translateX(3px); }
.sd-jobchip { border: 1.5px solid var(--border); background: #fff; border-radius: 8px; padding: 5px 9px; font-size: 11.5px; color: var(--ink-2); }
.sd-jobchip:hover { border-color: var(--blue); color: var(--blue-ink); }
.sd-jobchip b { color: var(--ink); }

/* SafeMail convert cards */
.convert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.convert-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); text-align: left; transition: transform .12s, border-color .12s, box-shadow .12s; }
.convert-card:hover { transform: translateY(-2px); border-color: var(--blue); box-shadow: var(--sh); }
.convert-card .cc-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; margin-bottom: 6px; }
.convert-card .cc-t { font-weight: 800; font-size: 14px; }
.convert-card .cc-s { font-size: 11.5px; color: var(--ink-3); font-weight: 600; font-family: ui-monospace, Menlo, monospace; }

/* compose */
.compose { position: fixed; right: 24px; bottom: 24px; width: 460px; max-width: 94vw; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--sh-lg); z-index: 120; overflow: hidden; animation: fadeUp .22s both; }
.compose-head { background: var(--grad); color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.compose-head button { background: rgba(255,255,255,.2); border: none; color: #fff; width: 28px; height: 28px; border-radius: 8px; }
.compose-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.compose-body label { font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; }
.compose-body input, .compose-body textarea, .compose-body select { width: 100%; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 13px; font-family: inherit; }
.compose-body input:focus, .compose-body textarea:focus { outline: none; border-color: var(--blue); }
.compose-foot { display: flex; gap: 10px; padding: 0 16px 16px; }

/* ---------- Offer Builder ---------- */
.ob-overlay { position: fixed; inset: 0; background: rgba(20,25,40,.5); backdrop-filter: blur(2px); z-index: 110; display: grid; place-items: center; padding: 18px; }
.ob { background: var(--surface); width: 1500px; max-width: 98vw; height: 94vh; border-radius: 16px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden; }
.ob-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.ob-body { flex: 1; display: grid; grid-template-columns: 268px 1fr 430px; overflow: hidden; }
.ob-col { overflow-y: auto; }
.ob-col-head { padding: 12px; font-weight: 800; font-size: 12.5px; border-bottom: 1px solid var(--border-2); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.ob-devices { background: var(--surface-2); border-right: 1px solid var(--border); }
.ob-dev { padding: 11px 12px; border-bottom: 1px solid var(--border-2); cursor: pointer; }
.ob-dev:hover { background: #fff; }
.ob-dev.active { background: #eef3fe; border-left: 3px solid var(--blue); padding-left: 9px; }
.ob-editor { border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.ob-dev-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.ob-group { padding: 4px 0; }
.ob-group-head { padding: 7px 16px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.ob-group-head.g-robocizna { background: #eef3fe; color: var(--blue-ink); }
.ob-group-head.g-materialy { background: #eafaf1; color: var(--green); }
.ob-group-head.g-uslugi { background: #f5f0ff; color: #6d3fe0; }
.ob-item { display: flex; align-items: center; gap: 8px; padding: 7px 16px; border-bottom: 1px solid #f3f4f6; }
.ob-item:hover { background: var(--surface-2); }
.ob-name { border: 1.5px solid transparent; border-radius: 6px; padding: 4px 6px; font-size: 13px; font-family: inherit; width: 100%; background: transparent; font-weight: 600; }
.ob-name:hover { border-color: var(--border); background: #fff; }
.ob-name:focus { outline: none; border-color: var(--blue); background: #fff; }
.ob-unit { font-size: 12px; color: var(--ink-3); width: 30px; }
.ob-total { font-weight: 800; font-size: 13px; width: 92px; text-align: right; color: var(--blue-ink); }
.ob-x { border: none; background: none; color: var(--ink-3); font-size: 12px; width: 22px; height: 22px; border-radius: 6px; }
.ob-x:hover { background: var(--red-bg); color: var(--red); }
.ob-add { margin: 4px 16px 8px; font-size: 12px; color: var(--blue-ink); background: none; border: 1.5px dashed var(--border); border-radius: 8px; padding: 6px 10px; font-weight: 700; }
.ob-add:hover { border-color: var(--blue); background: #f6f9ff; }
.ob-services { padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface-2); margin-top: auto; }
.ob-srv { font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: #fff; border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.ob-srv:hover { border-color: var(--blue); color: var(--blue-ink); }
.ob-srv.ai { background: var(--grad); color: #fff; border: none; }
.ob-preview { background: #f1f3f7; padding: 18px; }
.pdf { background: #fff; border-radius: 10px; box-shadow: var(--sh); padding: 22px; font-size: 12px; }
.pdf-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.pdf-dev { margin-top: 14px; padding: 12px; background: var(--surface-2); border-radius: 9px; }
.pdf-tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11px; }
.pdf-tbl th { text-align: left; padding: 6px 6px; border-bottom: 1.5px solid var(--border); font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); }
.pdf-tbl td { padding: 6px 6px; border-bottom: 1px solid var(--border-2); vertical-align: top; }
.pdf-totals { margin-top: 12px; margin-left: auto; width: 220px; }
.pdf-totals div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.pdf-totals .grand { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 8px; font-size: 15px; }
.pdf-totals .grand b { color: var(--blue-ink); }
.ob-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--border); gap: 16px; }
.ob-foot-totals { display: flex; gap: 28px; align-items: center; }

/* ---------- Panel Stack (drill-down kolumnowy) ---------- */
.stage { transition: transform .32s cubic-bezier(.22,.7,.25,1), filter .32s; transform-origin: left center; }
.stage.pushed { transform: translateX(calc(-1 * var(--push, 0px))); filter: brightness(.985); }
.panel-scrim { position: fixed; inset: 0; background: rgba(20,25,40,.34); backdrop-filter: blur(1.5px); z-index: 190; animation: scrimIn .25s both; }
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
.panel { position: fixed; top: 0; bottom: 0; background: transparent; transition: left .32s cubic-bezier(.22,.7,.25,1); animation: panelIn .34s cubic-bezier(.22,.7,.25,1) both; }
@keyframes panelIn { from { transform: translateX(46px); opacity: .2; } to { transform: none; opacity: 1; } }
.panel-inner { position: absolute; inset: 0; background: var(--surface); box-shadow: -18px 0 50px rgba(20,25,40,.20); border-left: 1px solid var(--border); overflow: hidden; }
.panel.covered .panel-inner { filter: brightness(.92) saturate(.9); }
.panel.covered .panel-inner::after { content: ""; position: absolute; inset: 0; background: rgba(20,25,40,.10); z-index: 50; }
.panel-spine { position: absolute; top: 0; bottom: 0; left: 0; z-index: 60; background: linear-gradient(180deg, #fbfcfe, #f1f3f8); border: none; border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 16px 0; cursor: pointer; }
.panel-spine:hover { background: linear-gradient(180deg, #eef3fe, #e7eefe); }
.panel-spine-txt { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; font-weight: 800; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 70%; letter-spacing: .3px; }
.panel-spine-ico { font-size: 20px; color: var(--blue-ink); font-weight: 800; line-height: 1; }
.panel-spine:hover .panel-spine-txt { color: var(--blue-ink); }

/* karta treści panelu (zastępuje dawny .modal) */
.pcard { height: 100%; display: flex; flex-direction: column; background: var(--surface); }

/* AI box */
.ai-box { border: 1.5px solid #e2e8fe; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg,#f5f8ff,#f8f5ff); }
.ai-head { display: flex; align-items: center; gap: 9px; padding: 11px 13px; }
.ai-spark { font-size: 16px; }
.ai-title { font-weight: 800; font-size: 13px; }
.ai-tag { font-size: 10px; font-weight: 800; color: #6d3fe0; background: #ede7fe; padding: 2px 7px; border-radius: 7px; text-transform: uppercase; letter-spacing: .5px; }
.ai-run { margin-left: auto; background: var(--grad); color: #fff; border: none; border-radius: 9px; padding: 7px 13px; font-size: 12.5px; font-weight: 700; }
.ai-run:disabled { opacity: .6; }
.ai-hint { padding: 0 13px 13px; font-size: 12.5px; color: var(--ink-3); }
.ai-body { padding: 0 13px 13px; }
.ai-result { font-size: 13px; color: var(--ink); line-height: 1.5; background: #fff; margin: 0 10px 10px; padding: 12px; border-radius: 9px; border: 1px solid var(--border); }
.ai-actions { display: flex; gap: 8px; margin-top: 8px; }
.ai-actions .btn { width: auto; }

/* Planer kierownika */
.planer { display: grid; grid-template-columns: 350px 1fr 330px; gap: 16px; align-items: start; }
.planer-list, .planer-map, .planer-days { display: flex; flex-direction: column; }
.planer-jobs { overflow-y: auto; max-height: 600px; padding: 8px; }
.planer-job { display: flex; gap: 10px; padding: 10px; border-radius: 10px; border: 1px solid var(--border-2); margin-bottom: 7px; }
.planer-job:hover { background: var(--surface-2); }
.planer-job.hl { background: #eef3fe; border-color: #cfe0fe; }
.planer-job > div:first-child { cursor: pointer; }
.planer-assign { display: flex; gap: 4px; margin-top: 7px; justify-content: flex-end; }
.planer-assign button { width: 23px; height: 23px; border-radius: 7px; border: none; color: #fff; font-size: 11px; font-weight: 800; }
.planer-assign button:hover { transform: scale(1.12); }
.map-pin.hl { z-index: 8; }
.planer-days-body { overflow-y: auto; max-height: 600px; }
.planer-day { border-bottom: 1px solid var(--border-2); padding: 11px 13px; }
.planer-day-head { font-weight: 800; font-size: 12.5px; }
.planer-chip { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px; margin-top: 5px; font-size: 11.5px; }
.planer-chip > span { cursor: pointer; }
.planer-chip button { border: none; background: none; color: var(--ink-3); font-size: 12px; }
.planer-chip button:hover { color: var(--red); }

/* ---------- Komunikator ---------- */
.overlay-r { position: fixed; inset: 0; background: rgba(20,25,40,.42); z-index: 300; display: flex; justify-content: flex-end; }
.msgr { background: #fff; width: 880px; max-width: 96vw; height: 100vh; display: flex; flex-direction: column; box-shadow: var(--sh-lg); animation: slidein .22s cubic-bezier(.2,.8,.2,1); }
@keyframes slidein { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.msgr-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.msgr-body { flex: 1; display: grid; grid-template-columns: 300px 1fr; overflow: hidden; }
.msgr-list { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface-2); }
.msgr-thread { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border-2); cursor: pointer; }
.msgr-thread:hover { background: #fff; }
.msgr-thread.active { background: #eef3fe; box-shadow: inset 3px 0 0 var(--blue); }
.msgr-avs { display: flex; }
.msgr-unread { background: var(--red); color: #fff; font-size: 10px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
.msgr-conv { display: flex; flex-direction: column; overflow: hidden; }
.msgr-conv-head { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.msgr-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(180deg,#fbfcfe,#f6f8fb); }
.msgr-msg { display: flex; gap: 10px; max-width: 80%; }
.msgr-msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msgr-bubble { background: #fff; border: 1px solid var(--border); padding: 10px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; box-shadow: var(--sh-sm); }
.msgr-msg.mine .msgr-bubble { background: var(--grad); color: #fff; border: none; }
.msgr-composer { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); align-items: center; }
.msgr-composer input { flex: 1; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 11px; font-size: 13.5px; font-family: inherit; }
.msgr-composer input:focus { outline: none; border-color: var(--blue); }
.msgr-send { width: 44px; height: 44px; border-radius: 11px; border: none; background: var(--grad); color: #fff; font-size: 17px; }
.msgr-attach { width: 42px; height: 42px; border-radius: 11px; border: 1.5px solid var(--border); background: #fff; font-size: 17px; flex-shrink: 0; }
.msgr-attach:hover { border-color: var(--blue); }
.msgr-pending { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 18px 12px; }
.msgr-pchip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; font-size: 12px; }
.msgr-pchip button { border: none; background: none; color: var(--ink-3); font-size: 11px; }
.msgr-atts { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }
.att-img { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); max-width: 220px; background: #fff; }
.att-img img { display: block; width: 100%; max-height: 200px; object-fit: cover; }
.att-img .att-name { display: block; padding: 5px 9px; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-file { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; min-width: 220px; }
.att-file.mine { background: rgba(255,255,255,.92); }
.att-ico { font-size: 22px; }
.att-fname { font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-fsize { font-size: 11px; color: var(--ink-3); }
.att-dl { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface-2); color: var(--blue-ink); display: grid; place-items: center; text-decoration: none; font-size: 14px; flex-shrink: 0; }
.att-dl:hover { border-color: var(--blue); }

/* kadry */
.kadry-chip { border: 1.5px solid var(--border); background: #fff; border-radius: 20px; padding: 7px 14px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.kadry-chip.on { color: #fff; border-color: transparent; }
.kr-tbl { border-collapse: collapse; font-size: 11px; width: 100%; }
.kr-tbl th, .kr-tbl td { border: 1px solid var(--border-2); padding: 5px 4px; text-align: center; min-width: 30px; }
.kr-tbl .kr-side { text-align: left; font-weight: 700; white-space: nowrap; position: sticky; left: 0; background: #fff; min-width: 150px; padding-left: 10px; }
.kr-tbl thead th { background: var(--surface-2); font-weight: 800; }
.kr-wknd { background: #fef2f2; color: var(--red); }
.kr-tbl .kr-sum { font-weight: 800; background: var(--surface-2); }
.kr-plan td { background: #eef3fe; }
.kr-otd td { background: #fffbeb; }
.kr-otc td { background: #ecfdf5; color: var(--green); font-weight: 700; }
.kr-foot { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--border-2); border-top: 1px solid var(--border); }
.kr-foot > div { background: #fff; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.kr-foot b { font-size: 18px; }

/* brygady */
.crew-member { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border); background: #fff; border-radius: 9px; padding: 5px 9px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.crew-member.on { border-color: var(--blue); background: #eef3fe; color: var(--blue-ink); }

/* trasy planer */
.route-row { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 10px; padding: 11px 13px; }
.route-opt { border: 1.5px solid var(--border); background: #fff; border-radius: 8px; padding: 5px 9px; font-size: 10.5px; color: var(--ink-3); font-weight: 600; line-height: 1.3; text-align: center; }
.route-opt b { color: var(--ink); font-size: 11px; }
.route-opt.on { border-color: var(--blue); background: #eef3fe; color: var(--blue-ink); }
.route-opt.on b { color: var(--blue-ink); }

/* recipient picker */
.rcp { position: relative; margin-top: 6px; }
.rcp-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border: 1.5px solid var(--border); border-radius: 11px; padding: 9px 11px; min-height: 46px; cursor: pointer; }
.rcp-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef3fe; color: var(--blue-ink); border-radius: 8px; padding: 3px 6px 3px 4px; font-size: 12.5px; font-weight: 600; }
.rcp-chip button { border: none; background: none; color: var(--blue-ink); font-size: 11px; }
.rcp-caret { margin-left: auto; color: var(--ink-3); }
.rcp-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh-md); padding: 6px; z-index: 10; max-height: 280px; overflow-y: auto; }
.rcp-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.rcp-opt:hover { background: var(--surface-2); }
.rcp-opt input { width: 16px; height: 16px; accent-color: var(--blue); }

/* ---------- Powiadomienia ---------- */
.notif-pop { position: fixed; top: 58px; right: 96px; width: 380px; max-width: 92vw; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--sh-lg); z-index: 300; overflow: hidden; animation: fadeUp .2s both; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--border-2); }
.notif-push { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: linear-gradient(135deg,#f3f7ff,#f8f5ff); border-bottom: 1px solid var(--border-2); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--border-2); cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: #f6f9ff; }
.notif-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; }

/* ---------- Admin ---------- */
.adm-inp { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 13.5px; font-family: inherit; }
.adm-inp:focus { outline: none; border-color: var(--blue); }
.adm-roles { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-role { background: none; border: 1.5px solid transparent; border-radius: 10px; padding: 3px; }
.adm-role.on { border-color: var(--blue); background: #f3f7ff; }

/* ---------- Protokół na tablecie ---------- */
.ppad-overlay { position: fixed; inset: 0; background: rgba(20,25,40,.55); z-index: 320; display: grid; place-items: center; padding: 16px; }
.ppad { background: #eef0f4; width: 1100px; max-width: 98vw; height: 96vh; border-radius: 16px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden; }
.ppad-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--border); }
.ppad-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--border); }
.ppad-tools { display: flex; align-items: center; gap: 7px; }
.ppad-tools button { border: 1.5px solid var(--border); background: #fff; border-radius: 9px; padding: 7px 12px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.ppad-tools button.on { border-color: var(--blue); color: var(--blue-ink); background: #f3f7ff; }
.ppad-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); padding: 0; }
.ppad-color.on { box-shadow: 0 0 0 2px var(--blue); }
.ppad-scroll { flex: 1; overflow-y: auto; padding: 22px; display: flex; justify-content: center; }
.ppad-doc { position: relative; width: 800px; max-width: 100%; }
.pdoc { background: #fff; border-radius: 6px; box-shadow: var(--sh-md); padding: 34px 38px; min-height: 1000px; font-size: 13px; }
.pdoc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 20px; margin: 16px 0; }
.pdoc-section { font-weight: 800; text-transform: uppercase; letter-spacing: .5px; font-size: 12px; color: var(--ink-3); margin: 18px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.pdoc-check { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.pdoc-box { width: 18px; height: 18px; border: 1.5px solid #1f2430; border-radius: 3px; flex-shrink: 0; }
.pdoc-notes { height: 90px; border: 1px dashed var(--border); border-radius: 6px; }
.pdoc-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.pdoc-sigline { border-bottom: 1.5px solid #1f2430; height: 60px; }
.ppad-canvas { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.ppad-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: #fff; border-top: 1px solid var(--border); }

/* protokoły — wzory z polami */
.proto-doc { background: #fff; border-radius: 8px; box-shadow: var(--sh-md); padding: 28px 32px; width: 820px; max-width: 100%; }
.proto-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; padding-bottom: 14px; border-bottom: 2px solid #1f2430; margin-bottom: 16px; font-size: 13px; }
.proto-section { margin-bottom: 18px; }
.proto-section-title { font-weight: 800; text-transform: uppercase; letter-spacing: .5px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--border); padding-bottom: 5px; margin-bottom: 10px; }
.proto-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.proto-check { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; user-select: none; }
.proto-check:hover { background: var(--surface-2); }
.proto-check.on { border-color: var(--green); background: #f1faf5; color: var(--green); }
.proto-box { width: 22px; height: 22px; border: 1.5px solid var(--ink-3); border-radius: 5px; display: grid; place-items: center; font-weight: 800; color: var(--green); flex-shrink: 0; }
.proto-check.on .proto-box { border-color: var(--green); background: #fff; }
.proto-field, .proto-full { display: flex; flex-direction: column; }
.proto-full { grid-column: 1 / -1; }
.proto-input { padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 13px; font-family: inherit; }
.proto-input:focus { outline: none; border-color: var(--blue); }
.proto-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.sig-wrap { display: flex; flex-direction: column; }
.sig-canvas { border: 1.5px dashed var(--border); border-radius: 9px; height: 110px; touch-action: none; cursor: crosshair; background: #fff; }
.proto-pick { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px solid var(--border); border-radius: 12px; background: #fff; text-align: left; }
.proto-pick:hover { border-color: var(--blue); box-shadow: var(--sh); transform: translateY(-2px); transition: all .12s; }

/* ---------- Drzewo plików ---------- */
.ftree { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ftree-row { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border-2); }
.ftree-row:hover { background: var(--surface-2); }
.ftree-row.top { font-weight: 800; background: var(--surface-2); }
.ftree-caret { width: 14px; color: var(--ink-3); font-size: 11px; }
.ftree-sub .ftree-row { padding-left: 30px; font-weight: 600; }
.ftree-file { display: flex; align-items: center; gap: 9px; padding: 7px 14px 7px 46px; border-bottom: 1px solid var(--border-2); }
.ftree-file:hover { background: #f9fbff; }

/* ---------- Ryzyka ---------- */
.risk-row { background: var(--surface-2); border-radius: 10px; padding: 11px 13px; }

/* density tweak */
:root[data-density="comfy"] .tbl tbody td { padding: 18px 18px; }
:root[data-density="comfy"] .tbl thead th { padding: 15px 18px; }
:root[data-density="comfy"] .stab { padding: 11px 16px; }

/* === panel_neutralize.css === */

/* ====== Panele drill-down: neutralizacja starego markup .overlay/.modal ====== */
/* Partiale paneli były pisane jako slide-over (.overlay+.modal). Wewnątrz panel-stack
   mają wypełniać kontener, nie pozycjonować się fixed. */
.panel-inner .overlay { position: static; inset: auto; background: none; backdrop-filter: none; display: block; height: 100%; }
.panel-inner .modal { width: 100%; max-width: none; height: 100%; box-shadow: none; animation: none; border-radius: 0; display: flex; flex-direction: column; }
.panel-inner turbo-frame { display: block; height: 100%; }

/* === modal_chrome.css === */

/* ====== Modal/panel chrome (nagłówek, body, akcje) — brakujące w Rails ====== */
.panel-inner .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.panel-inner .modal-title { font-size: 19px; font-weight: 800; }
.panel-inner .modal-x { width: 34px; height: 34px; border-radius: 9px; border: none; background: var(--surface-2); color: var(--ink-2); font-size: 17px; display: grid; place-items: center; text-decoration: none; cursor: pointer; }
.panel-inner .modal-x:hover { background: #eceef3; }
.panel-inner .modal-body { flex: 1; overflow-y: auto; padding: 22px 24px; }
.panel-inner .modal-actions { border-top: 1px solid var(--border); padding: 16px 24px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); flex-shrink: 0; }
.panel-inner .modal-actions .actions-row { display: flex; gap: 10px; }
.panel-inner .modal-actions .actions-row > * { flex: 1; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }

/* === panel_close.css === */

/* ====== Panel: animacja zamykania (lustrzane otwieranie) + scrim fade ====== */
.panel { transition: left .32s cubic-bezier(.22,.7,.25,1); }
.panel.closing { transition: transform .3s cubic-bezier(.4,0,.6,1), opacity .3s ease; transform: translateX(46px); opacity: 0; pointer-events: none; }
.panel-inner { transition: filter .25s; }
#ps-scrim { transition: opacity .3s; }

/* === crews_chips.css === */

/* ====== Ekipy dziś: chipy godzina+miasto + km ====== */
.sd-crew { padding-left: 11px; margin-bottom: 14px; }
.sd-crew-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sd-crew-stops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.sd-stop { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--border); background: #fff; border-radius: 8px; padding: 4px 9px; font-size: 12px; color: var(--ink-2); cursor: pointer; transition: all .12s; }
.sd-stop b { color: var(--cc, var(--blue-ink)); font-weight: 800; }
.sd-stop:hover { border-color: var(--cc, var(--blue)); background: var(--surface-2); transform: translateY(-1px); }

/* === crews_end.css === */

/* ====== Ekipy: km na pillsie + pill powrotu/noclegu ====== */
.sd-stop-km { color: var(--ink-3); font-weight: 600; font-size: 11px; margin-left: 2px; }
.sd-stop-end { background: var(--surface-2); border-style: dashed; color: var(--ink-2); cursor: default; }
.sd-stop-end:hover { transform: none; border-color: var(--border); background: var(--surface-2); }

/* === map_logo.css === */

/* ====== Mapa: logo HQ (EPS) dopasowane do kwadratu, bez ucięcia ====== */
.hq-icon { background: none; border: none; }
.hq-pin { width: 36px; height: 36px; border-radius: 9px; background: #fff; border: 2px solid var(--blue); box-shadow: 0 3px 10px rgba(20,25,40,.25); display: grid; place-items: center; overflow: hidden; padding: 3px; }
.hq-pin img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.hq-pin.outsourcing { border-color: var(--amber); }
.hq-name { margin-top: 3px; font-size: 10px; font-weight: 800; color: var(--ink); background: #fff; padding: 1px 6px; border-radius: 6px; box-shadow: var(--sh-sm); white-space: nowrap; transform: translateX(calc(-50% + 18px)); display: inline-block; }

/* === map_logo2.css === */

/* ====== Mapa: logo HQ jako background (cover), bez ucięcia ====== */
.hq-icon { background: none; border: none; }
.hq-pin { width: 40px; height: 40px; border-radius: 10px; background-color: #fff; background-size: cover; background-position: center; background-repeat: no-repeat; border: 2px solid var(--blue); box-shadow: 0 3px 10px rgba(20,25,40,.28); }
.hq-pin.partner { border-color: var(--amber); }
.hq-name { margin-top: 3px; font-size: 10px; font-weight: 800; color: var(--ink); background: #fff; padding: 1px 6px; border-radius: 6px; box-shadow: var(--sh-sm); white-space: nowrap; transform: translateX(calc(-50% + 20px)); display: inline-block; }

/* === sparkline.css === */

/* ====== Sparkline trend (7 dni, dziś najmocniejszy) ====== */
.sd-spark { display: flex; align-items: flex-end; gap: 3px; height: 36px; }
.spark-bar { width: 7px; border-radius: 3px 3px 1px 1px; transition: opacity .12s, transform .12s; cursor: default; }
.spark-bar:hover { transform: scaleY(1.06); opacity: 1 !important; }
.spark-bar.today { box-shadow: 0 0 0 1.5px rgba(255,255,255,.6) inset; }

/* === sidebar_polish.css === */

/* ====== Sidebar polish: bez szarej kreski nad zakładkami + zakryty panel pokazuje tylko grzbiet ====== */
.panel-inner .modal-head { border-bottom: none !important; padding-bottom: 6px; }
.panel-inner .modal-tabs { padding-top: 4px; border-bottom: none !important; }

/* Zakryty panel: chowamy całą treść, zostaje tylko grzbiet (spine) */
.panel.covered .panel-inner { visibility: hidden; }
.panel.covered .panel-spine { visibility: visible; }
.panel.covered .panel-inner::after { display: none; }

/* === spine.css === */

/* ====== Grzbiet zakrytego panelu — szerszy i wyraźniejszy ====== */
.panel.covered .panel-inner { pointer-events: none; }
.panel-spine { position: absolute; top: 0; left: 0; bottom: 0; width: 72px; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(180deg, #fbfcfe, #eef1f6); border: none; border-right: 1px solid var(--border);
  cursor: pointer; transition: background .15s; }
.panel-spine:hover { background: linear-gradient(180deg, #eef3fe, #dfeafe); }
.panel-spine-ico { font-size: 26px; font-weight: 800; color: var(--blue-ink); line-height: 1; }
.panel-spine-txt { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 13px; font-weight: 800;
  color: var(--ink-2); letter-spacing: .4px; white-space: nowrap; max-height: 70%; overflow: hidden; text-overflow: ellipsis; }
.panel-spine:hover .panel-spine-txt { color: var(--blue-ink); }
.panel.covered .panel-inner::after { content: ""; position: absolute; inset: 0; background: rgba(20,25,40,.06); z-index: 5; pointer-events: none; }

/* === spine_fix.css === */

/* ====== Grzbiet: domknięcie 6px dziury — szerokość = PEEK (78px) ====== */
.panel-spine { width: 80px !important; }

/* === spine_label.css === */

/* ====== Grzbiet: nagłówek u góry (strzałka + pionowy tytuł) ====== */
.panel-spine { justify-content: flex-start !important; padding-top: 18px !important; gap: 10px !important; }
.panel-spine-ico { font-size: 24px; }
.panel-spine-txt { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 13px; font-weight: 800; color: var(--ink-2); letter-spacing: .3px; white-space: nowrap; max-height: 80%; overflow: hidden; text-overflow: ellipsis; }
.panel-spine:hover .panel-spine-txt { color: var(--blue-ink); }

/* === mtab.css === */

/* ====== Zakładki panelu (.mtab) — styl z prototypu ====== */
.panel-inner .modal-tabs, .modal-tabs { display: flex; gap: 8px; padding: 0 24px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.mtab { display: inline-flex !important; align-items: center; gap: 7px; padding: 8px 15px !important; border-radius: 10px !important; background: var(--surface-2) !important; border: none !important; font-size: 13px; font-weight: 600; color: var(--ink-2) !important; cursor: pointer; box-shadow: none !important; transition: background .12s, color .12s; }
.mtab:hover { background: #eceef3 !important; }
.mtab.active { background: var(--grad) !important; color: #fff !important; box-shadow: var(--sh) !important; }
.mtab .mt-badge { background: rgba(0,0,0,.12); padding: 0 7px; border-radius: 8px; font-size: 11px; font-weight: 800; }
.mtab.active .mt-badge { background: rgba(255,255,255,.28); }

/* === offer_panel.css === */

/* ====== Offer Builder w panelu slide-over (dopasowanie do .panel-inner) ====== */
.panel-inner .ob { position: static; width: 100%; height: 100%; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; min-height: 0; }
.panel-inner .ob-head { background: var(--grad); color: #fff; flex-shrink: 0; }
.panel-inner .ob-head .eps-mark { background: rgba(255,255,255,.18); }
.panel-inner .ob-head .cell-sub { color: rgba(255,255,255,.85); }
.panel-inner .ob-head .modal-x { background: rgba(255,255,255,.2); color: #fff; }
.panel-inner #offer_panel, .panel-inner turbo-frame#offer_panel { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.panel-inner .ob-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 230px 1fr 300px; overflow: hidden; }
.panel-inner .ob-col { overflow-y: auto; min-height: 0; }
.panel-inner .ob-foot { flex-shrink: 0; }
.ob-num { border: 1.5px solid var(--border); border-radius: 7px; padding: 5px 7px; font-size: 12.5px; font-family: inherit; text-align: right; }
.ob-srv form, .ai-run form { display: inline; }

/* === panel_fix.css === */

/* ====== Panel: poprawny wewnętrzny scroll + przyklejone elementy ====== */
.panel-inner { display: flex; flex-direction: column; height: 100%; }
.panel-inner .overlay { position: static; inset: auto; background: none; backdrop-filter: none; display: flex; flex-direction: column; height: 100%; min-height: 0; }
.panel-inner .modal { width: 100%; max-width: none; height: 100%; box-shadow: none; animation: none; border-radius: 0; display: flex; flex-direction: column; min-height: 0; }
.panel-inner turbo-frame { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.panel-inner .modal-head { flex-shrink: 0; }
.panel-inner .modal-tabs { flex-shrink: 0; overflow-x: auto; }
.panel-inner .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.panel-inner .modal-actions { flex-shrink: 0; }
.mt-badge { display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 8px; background: rgba(0,0,0,.10); font-size: 11px; font-weight: 800; }
.mtab.active .mt-badge { background: rgba(255,255,255,.28); }

/* ====== Filter pills (aktywne filtry tabel) ====== */
.active-pills:empty { display: none; }
.active-pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; }
.filter-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; background: #e8f0fe; border: 1.5px solid #c5d8fd; border-radius: 9px; font-size: 12px; cursor: pointer; }
.filter-pill:hover { background: #d4e4fd; }
.fp-col { color: var(--ink-3); font-weight: 600; }
.fp-op { color: var(--ink-3); font-size: 11px; }
.fp-val { color: var(--blue-ink); font-weight: 700; }
.fp-x { color: var(--ink-3); margin-left: 2px; }

/* ====== Animacja zamykania (lustro otwierania) ====== */
.panel { animation: panelIn .32s cubic-bezier(.22,.7,.25,1); }
@keyframes panelIn { from { transform: translateX(46px); opacity: .2; } to { transform: none; opacity: 1; } }
.panel.closing { animation: none; transition: transform .3s cubic-bezier(.4,0,.6,1), opacity .3s ease; transform: translateX(48px); opacity: 0; pointer-events: none; }

/* === datatable_fix.css === */

/* ====== DataTable — KOMPLETNE style z prototypu ====== */
/* twarde wyzerowanie sticky z bazowego CSS (nagłówek nie ma się przyklejać) */
.dt thead tr.head-row th, .dt thead tr.filter-row th { position: static !important; top: auto !important; }
.filterpills:empty { display: none !important; margin: 0 !important; }
.dt-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: visible; }
.dt-scroll { overflow-x: auto; border-radius: var(--r-lg); }
.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.dt thead th { background: var(--surface-2); text-align: left; font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.dt thead tr.head-row th { padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); cursor: pointer; user-select: none; }
.dt thead tr.head-row th:hover { background: #eef0f4; color: var(--ink-2); }
.dt thead tr.head-row th .sort-ico { margin-left: 5px; font-size: 10px; }
.dt thead tr.head-row th.sorted { color: var(--blue-ink); }
.dt thead tr.filter-row th { padding: 7px 10px; border-bottom: 1px solid var(--border); background: var(--surface); }
.dt tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.dt tbody tr { cursor: pointer; transition: background .08s; }
.dt tbody tr:hover { background: #f9fbff; }
.dt tbody tr.warn { background: var(--yellow-row); }
.dt tbody tr.warn:hover { background: #fff7df; }
:root[data-density="comfy"] .dt tbody td { padding: 18px 16px; }

.fcell { display: flex; align-items: stretch; gap: 0; border: 1.5px solid var(--border); border-radius: 9px; background: var(--surface); position: relative; height: 34px; transition: border-color .12s, box-shadow .12s; }
.fcell:hover { border-color: #d4d9e3; }
.fcell:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,246,.12); }
.fcell.has-val { border-color: var(--blue); background: #f4f8ff; box-shadow: inset 0 0 0 1px rgba(47,107,246,.18); }
.fop { flex-shrink: 0; padding: 0 8px; font-size: 12px; font-weight: 800; color: var(--ink-3); border-right: 1.5px solid var(--border); background: transparent; line-height: 1; border-radius: 7px 0 0 7px; display: grid; place-items: center; min-width: 30px; cursor: pointer; }
.fop:hover { background: var(--surface-2); color: var(--blue-ink); }
.fcell.has-val .fop { color: var(--blue-ink); border-color: rgba(47,107,246,.2); }
.fcell input { border: none; background: transparent; padding: 0 8px; font-size: 12.5px; width: 100%; min-width: 50px; color: var(--ink); font-family: inherit; }
.fcell input:focus { outline: none; }
.fcell input::placeholder { color: var(--ink-3); }
.fcaret { flex-shrink: 0; padding: 0 8px; color: var(--ink-3); font-size: 10px; background: transparent; border: none; border-left: 1.5px solid var(--border); display: grid; place-items: center; cursor: pointer; }
.fcaret:hover { background: var(--surface-2); color: var(--blue-ink); }
.fcaret.on { color: var(--blue-ink); }
.fchips { display: flex; align-items: center; gap: 4px; padding: 0 6px; flex: 1; min-width: 0; overflow: hidden; }
.fchip { font-size: 11px; font-weight: 700; color: var(--blue-ink); white-space: nowrap; }
.fclear { flex-shrink: 0; padding: 0 7px; color: var(--ink-3); font-size: 13px; background: none; border: none; cursor: pointer; }
.fclear:hover { color: var(--red); }
.fmenu { position: absolute; top: calc(100% + 5px); left: 0; z-index: 70; background: #fff; border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--sh-md); padding: 5px; min-width: 178px; }
.fmenu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 10px; border-radius: 7px; border: none; background: none; font-size: 12.5px; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.fmenu button:hover { background: var(--surface-2); }
.fmenu button.sel { background: #eef3fe; color: var(--blue-ink); }
.fmenu .fglyph { width: 20px; color: var(--ink-3); font-weight: 800; text-align: center; }

.fvalues { position: absolute; top: calc(100% + 5px); right: 0; z-index: 70; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh-lg); width: 244px; overflow: hidden; }
.fv-head { padding: 9px 11px; border-bottom: 1px solid var(--border-2); }
.fv-search { position: relative; }
.fv-search input { width: 100%; padding: 7px 10px 7px 28px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 12.5px; font-family: inherit; }
.fv-search input:focus { outline: none; border-color: var(--blue); }
.fv-search .si { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--ink-3); }
.fv-actions { display: flex; gap: 8px; padding: 7px 11px; border-bottom: 1px solid var(--border-2); }
.fv-actions button { font-size: 11.5px; font-weight: 700; color: var(--blue-ink); background: none; border: none; padding: 2px 4px; border-radius: 6px; cursor: pointer; }
.fv-actions .sep { color: var(--border); }
.fv-list { max-height: 230px; overflow-y: auto; padding: 5px; }
.fv-opt { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 12.5px; color: var(--ink); }
.fv-opt:hover { background: var(--surface-2); }
.fv-opt input { width: 15px; height: 15px; accent-color: var(--blue); flex-shrink: 0; }
.fv-opt .fv-lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv-opt .fv-cnt { font-size: 11px; color: var(--ink-3); font-weight: 700; background: var(--surface-2); padding: 1px 6px; border-radius: 8px; }
.fv-foot { display: flex; gap: 8px; padding: 9px 11px; border-top: 1px solid var(--border-2); }
.fv-foot button { flex: 1; padding: 8px; border-radius: 8px; font-size: 12.5px; font-weight: 700; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.fv-foot button.primary { background: var(--grad); color: #fff; border: none; }

.filterpills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.fpill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 6px 5px 11px; border-radius: 9px; background: #eef3fe; border: 1px solid #d7e4fe; color: var(--blue-ink); font-size: 12.5px; font-weight: 600; }
.fpill .fp-col { font-weight: 800; }
.fpill .fp-op { color: var(--ink-3); font-weight: 600; }
.fpill .fp-x { width: 18px; height: 18px; border-radius: 6px; border: none; background: rgba(47,107,246,.12); color: var(--blue-ink); font-size: 12px; display: grid; place-items: center; cursor: pointer; }
.fpill .fp-x:hover { background: var(--red); color: #fff; }
.fpills-clear { font-size: 12.5px; font-weight: 700; color: var(--ink-3); background: none; border: none; padding: 5px 8px; border-radius: 8px; cursor: pointer; }
.fpills-clear:hover { color: var(--red); background: var(--red-bg); }

.dt-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); gap: 14px; flex-wrap: wrap; }
.dt-foot .pg-info { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.pg { display: flex; align-items: center; gap: 4px; }
.pg button { min-width: 32px; height: 32px; padding: 0 9px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.pg button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue-ink); }
.pg button.active { background: var(--grad); color: #fff; border-color: transparent; }
.pg button:disabled { opacity: .4; cursor: default; }
.pg-size { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.pg-size select { padding: 5px 8px; border-radius: 8px; border: 1.5px solid var(--border); font-size: 12.5px; font-family: inherit; background: var(--surface); color: var(--ink); }

/* === nav_active.css === */
/* nav active — styl prototypu (subtelny), bez wzmocnień */

/* === builder_wide.css === */

/* 3 kolumny z osobnym scrollem */
.panel-inner .ob { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.panel-inner .ob-head { flex-shrink: 0; }
.panel-inner .ob-clientbar { flex-shrink: 0; }
.panel-inner #offer_content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ob-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 240px minmax(0,1fr) 50%; overflow: hidden; }
.ob-col { overflow-y: auto; min-height: 0; }
.ob-devices { border-right: 1px solid var(--border); background: var(--surface-2); }
.ob-editor { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ob-preview { border-left: 1px solid var(--border); background: #eef0f4; padding: 18px; }
.panel-inner .ob-foot { flex-shrink: 0; }

.ob-col-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 12px 6px; font-weight: 800; font-size: 12.5px; }
.ob-mini-add { background: var(--blue); color: #fff; border: none; border-radius: 7px; width: 26px; height: 26px; cursor: pointer; font-size: 13px; }

/* karty urządzeń w kolumnie */
.ob-dev { margin: 0 10px 8px; padding: 10px; background: #fff; border: 2px solid var(--border); border-radius: 10px; transition: all .12s; }
.ob-dev.active { border-color: var(--blue); background: #f5f9ff; }
.ob-devcheck { padding: 0 !important; background: none !important; border: none !important; }
.ob-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); display: grid; place-items: center; font-weight: 800; color: #fff; background: #fff; cursor: pointer; font-size: 12px; flex-shrink: 0; }
.ob-dev.active .ob-check { background: var(--blue); border-color: var(--blue); }
.ob-edit-mini { background: var(--surface-2); border: none; border-radius: 6px; width: 26px; height: 26px; cursor: pointer; font-size: 12px; flex-shrink: 0; }
.ob-edit-mini:hover { background: #e6ebf5; }

/* pasek urządzenia w edytorze */
.ob-dev-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; background: var(--surface-2); border-radius: 10px; }

/* grupy pozycji */
.ob-group { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.ob-group-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface-2); font-weight: 800; font-size: 13px; border-bottom: 1px solid var(--border); }
.ob-group-sum { margin-left: auto; color: var(--blue-ink); }
.ob-item { display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-bottom: 1px solid var(--border-2); }
.ob-name { width: 100%; border: 1.5px solid transparent; border-radius: 7px; padding: 5px 8px; font-size: 13px; font-weight: 600; font-family: inherit; }
.ob-name:hover { border-color: var(--border); }
.ob-name:focus { outline: none; border-color: var(--blue); background: #f5f9ff; }
.ob-num { border: 1.5px solid var(--border); border-radius: 7px; padding: 5px 7px; font-size: 12.5px; font-family: inherit; text-align: right; }
.ob-num:focus { outline: none; border-color: var(--blue); }
.ob-dev-pick { border: 1.5px solid var(--border); border-radius: 7px; padding: 5px; font-size: 11px; font-family: inherit; max-width: 100px; }
.ob-unit { font-size: 11.5px; color: var(--ink-3); }
.ob-total { min-width: 80px; text-align: right; font-weight: 800; font-size: 12.5px; }
.ob-x { width: 24px; height: 24px; border-radius: 6px; border: none; background: none; color: var(--ink-3); cursor: pointer; text-decoration: none; display: grid; place-items: center; }
.ob-x:hover { background: var(--red-bg); color: var(--red); }
.ob-add { margin: 8px 13px; background: none; border: 1.5px dashed var(--border); border-radius: 8px; padding: 7px 11px; font-size: 12px; font-weight: 700; color: var(--blue-ink); cursor: pointer; width: auto; }
.ob-add:hover { border-color: var(--blue); background: #f5f9ff; }
.ob-services { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; }
.ob-srvgrid { display: flex; flex-wrap: wrap; gap: 7px; }
.ob-srv { background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 9px; padding: 6px 10px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.ob-srv:hover { border-color: var(--blue); color: var(--blue-ink); }
.ob-srv-price { color: var(--ink-3); font-weight: 800; }

/* podgląd PDF */
.ob-preview .pdf { background: #fff; border-radius: 10px; padding: 22px; box-shadow: var(--sh-sm); font-size: 12px; }
.pdf-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; }
.pdf-dev { margin: 12px 0 6px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }
.pdf-tbl { width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 8px; }
.pdf-tbl th { text-align: left; padding: 5px 6px; border-bottom: 2px solid var(--border); font-size: 10px; text-transform: uppercase; color: var(--ink-3); }
.pdf-tbl td { padding: 5px 6px; border-bottom: 1px solid var(--border-2); }
.pdf-totals { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.pdf-totals > div { display: flex; gap: 24px; font-size: 12px; }
.pdf-totals .grand { font-size: 15px; font-weight: 800; color: var(--blue-ink); border-top: 2px solid var(--border); padding-top: 6px; margin-top: 3px; }

/* stopka */
.panel-inner .ob-foot { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 20px; border-top: 1px solid var(--border); background: #fff; }
.ob-foot-totals { display: flex; gap: 24px; }
.ob-foot-totals > div { display: flex; flex-direction: column; }

/* CRM/Optima search modal */
.crm-overlay { position: fixed; inset: 0; background: rgba(20,25,40,.45); z-index: 400; display: grid; place-items: center; }
.crm-modal { background: #fff; width: 640px; max-width: 94vw; max-height: 84vh; border-radius: 16px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden; }
.crm-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; background: var(--grad); color: #fff; font-weight: 800; }
.crm-body { padding: 16px 18px; overflow-y: auto; }
.crm-srcrow { display: flex; gap: 8px; margin-bottom: 12px; }
.crm-srcrow input { flex: 1; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; }
.crm-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.crm-tab { padding: 6px 13px; border-radius: 8px; border: 1.5px solid var(--border); background: #fff; font-size: 12.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.crm-tab.on { background: var(--grad); color: #fff; border: none; }
.crm-res { display: flex; flex-direction: column; gap: 8px; }
.crm-card { border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; cursor: pointer; }
.crm-card:hover { border-color: var(--blue); background: #f6f9ff; }

/* === edit_forms.css === */

/* ====== Formularze edycji w panelu (klient/urządzenie) ====== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .fld { display: flex; flex-direction: column; gap: 4px; }
.form-grid .fld span { font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; }
.form-grid .fld .adm-inp { width: 100%; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 13.5px; font-family: inherit; }
.form-grid .fld .adm-inp:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,246,.12); }

/* === contacts.css === */

/* ====== Kontakty klienta ====== */
.ct-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-2); }
.ct-row:last-child { border-bottom: none; }
.ct-avatar { width: 34px; height: 34px; border-radius: 9px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.ct-avatar.ct-gray { background: var(--surface-2); color: var(--ink-3); }
.ct-actions { display: flex; gap: 4px; }
.ct-btn { width: 28px; height: 28px; border-radius: 7px; border: none; background: var(--surface-2); cursor: pointer; font-size: 12px; display: grid; place-items: center; }
.ct-btn:hover { background: #e6ebf5; }
.ct-inactive { opacity: .55; }
.ct-archived { display: none; }
#contacts-list.show-archived .ct-archived { display: block; }
.ct-edit { background: var(--surface-2); border-radius: 10px; margin: 4px 0 8px; padding: 4px 8px; }
.ct-new { margin-top: 8px; }
.ct-new summary { list-style: none; }
.ct-new summary::-webkit-details-marker { display: none; }
/* formularz edycji klienta — normalny sidebar, nie pełnoekranowy */
.panel-inner .pcard { max-width: none; width: 100%; }
/* timeline */
.tl-row { display: flex; align-items: flex-start; gap: 10px; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin-top: 4px; flex-shrink: 0; }

/* ====== Uniwersalny avatar z inicjałami ====== */
.av { display: inline-grid; place-items: center; border-radius: 9px; font-weight: 800; color: #fff; flex-shrink: 0; text-transform: uppercase; line-height: 1; }
.av-xs { width: 22px; height: 22px; font-size: 9px; border-radius: 6px; }
.av-sm { width: 30px; height: 30px; font-size: 11px; }
.av-md { width: 38px; height: 38px; font-size: 14px; }
.av-lg { width: 48px; height: 48px; font-size: 17px; border-radius: 12px; }
/* Kolory generowane z pierwszej litery */
.av-a,.av-b,.av-c { background: #5b6abf; }
.av-d,.av-e,.av-f { background: #d97757; }
.av-g,.av-h,.av-i { background: #1f8a5b; }
.av-j,.av-k,.av-l { background: #9b59b6; }
.av-m,.av-n,.av-o { background: #2980b9; }
.av-p,.av-q,.av-r { background: #e67e22; }
.av-s,.av-t,.av-u { background: #16a085; }
.av-v,.av-w,.av-x { background: #c0392b; }
.av-y,.av-z       { background: #8e44ad; }
.av-default       { background: var(--ink-3); }


/* === offer_editor.css === */

/* ====== Oferta: accordion per urządzenie + predefiniowane materiały ====== */
.ob-dev-accordion { border: 2px solid var(--border) !important; }
.ob-dev-accordion[open] { border-color: var(--blue) !important; }
.ob-dev-head { gap: 6px !important; flex-wrap: wrap; }
.ob-dev-model { font-weight: 800; font-size: 14px; color: var(--ink); }
.ob-dev-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ob-review-select { padding: 4px 8px; border: 1.5px solid var(--border); border-radius: 7px; font-size: 11.5px; font-weight: 700; font-family: inherit; background: #fff; color: var(--blue-ink); }
.ob-review-select:focus { outline: none; border-color: var(--blue); }

/* Podgrupy wewnątrz accordion urządzenia */
.ob-subgroup { border-top: 1px solid var(--border-2); }
.ob-subgroup-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-weight: 700; font-size: 12.5px; color: var(--ink-2); background: #fafbfd; }
.ob-subgroup-head .ob-group-sum { margin-left: auto; }

/* Predefiniowany wiersz materiału (filtr z katalogu) */
.ob-item-predef { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-bottom: 1px solid var(--border-2); background: #f9fbff; }
.ob-predef-name { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ob-add-mini { background: none; border: 1px solid var(--blue); border-radius: 6px; padding: 3px 8px; font-size: 11px; font-weight: 700; color: var(--blue-ink); cursor: pointer; }
.ob-add-mini:hover { background: var(--blue); color: #fff; }

/* Przełączniki w nagłówku — style z prototypu */
.ob-type-switch { display: flex; align-items: center; gap: 6px; }
.ob-sw-label { font-size: 11px; font-weight: 800; color: rgba(255,255,255,.7); text-transform: uppercase; }
.ob-sw-select { padding: 5px 8px; border-radius: 7px; border: 1.5px solid rgba(255,255,255,.3); background: rgba(255,255,255,.15); color: #fff; font-size: 12px; font-weight: 700; font-family: inherit; }
.ob-sw-select option { color: var(--ink); background: #fff; }

/* Accordion (details/summary) */
.ob-group { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.ob-group + .ob-group { margin-top: 10px; }
.ob-group > summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface-2); font-weight: 800; font-size: 13px; border-bottom: 1px solid var(--border); cursor: pointer; list-style: none; user-select: none; }
.ob-group > summary::-webkit-details-marker { display: none; }
.ob-group > summary::before { content: "▸"; font-size: 12px; color: var(--ink-3); transition: transform .15s; }
.ob-group[open] > summary::before { transform: rotate(90deg); }
.ob-group-sum { margin-left: auto; color: var(--blue-ink); font-weight: 800; }

/* === new_offer_panel.css === */

/* ====== Nowa oferta — panel wyboru klienta ====== */
.np-search { margin-bottom: 4px; }
.np-list { display: flex; flex-direction: column; gap: 0; }
.np-client { display: flex; align-items: center; gap: 10px; padding: 11px 8px; border-bottom: 1px solid var(--border-2); transition: background .08s; }
.np-client:hover { background: #f6f9ff; }
.np-client:last-child { border-bottom: none; }

/* SERWIS_EXTRAS_END */

/* ═══════════════════════════════════════════════════════
   OB3 — Offer Builder v3 (3-kolumnowy, własny scroll)
   ═══════════════════════════════════════════════════════ */

/* Wrapper — 3 kolumny z własnym scrollem */
.ob3-wrap {
  display: grid;
  grid-template-columns: 220px 1fr 42%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.ob3-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.ob3-col-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* Kolumna 1 — urządzenia */
.ob3-devices {
  background: var(--surface-2);
  border-right: 1px solid var(--border);
}

.ob3-dev-list { padding: 6px; display: flex; flex-direction: column; gap: 5px; }

.ob3-dev-card {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 10px 10px 8px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transition: border-color .15s, background .15s;
}
.ob3-dev-card:hover { border-color: var(--blue); background: #f6f9ff; }
.ob3-dev-card.active { border-color: var(--blue); background: #eef3fe; }

.ob3-dev-check {
  width: 20px; height: 20px;
  border-radius: 5px;
  border: 2px solid var(--border);
  background: #fff;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #fff;
  flex-shrink: 0; margin-top: 1px;
}
.ob3-dev-card.active .ob3-dev-check { background: var(--blue); border-color: var(--blue); }

.ob3-dev-info { flex: 1; min-width: 0; }
.ob3-dev-model { font-weight: 700; font-size: 12.5px; color: var(--ink); line-height: 1.3; }
.ob3-dev-sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.ob3-dev-loc { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.ob3-dev-amt { font-size: 11.5px; font-weight: 800; color: var(--blue-ink); margin-top: 4px; white-space: nowrap; }

/* Kolumna 2 — edytor */
.ob3-editor {
  border-right: 1px solid var(--border);
  background: var(--surface);
}

/* Accordion */
.ob3-accordion {
  border-bottom: 1px solid var(--border-2);
  margin: 0;
}
.ob3-accordion[open] { border-left: 3px solid var(--blue); }

.ob3-acc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
  gap: 8px;
  background: var(--surface);
  user-select: none;
}
.ob3-acc-head::-webkit-details-marker { display: none; }
.ob3-acc-head:hover { background: var(--surface-2); }

.ob3-acc-title { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.ob3-acc-icon { font-size: 18px; flex-shrink: 0; }
.ob3-acc-model { font-weight: 800; font-size: 13.5px; color: var(--ink); }
.ob3-acc-sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.ob3-acc-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ob3-acc-sum { font-weight: 800; font-size: 13px; color: var(--blue-ink); }
.ob3-acc-chevron { font-size: 13px; color: var(--ink-3); transition: transform .2s; }
details.ob3-accordion[open] .ob3-acc-chevron { transform: rotate(180deg); }

.ob3-acc-body { padding-bottom: 6px; }

/* Sections inside accordion */
.ob3-section {
  padding: 10px 14px 8px;
  border-top: 1px solid var(--border-2);
}
.ob3-section-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .4px; color: var(--ink-3); margin-bottom: 8px;
}
.ob3-section-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 800; color: var(--ink-2);
  margin-bottom: 6px;
}
.ob3-section-sum { font-weight: 800; color: var(--blue-ink); }

/* Pills — rodzaj przeglądu */
.ob3-pills { display: flex; flex-wrap: wrap; gap: 6px; }

.ob3-pill {
  padding: 5px 13px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 12px; font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.ob3-pill:hover { border-color: var(--blue); color: var(--blue-ink); }
.ob3-pill.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.ob3-pill-coolant { display: flex; align-items: center; gap: 6px; }
.ob3-pill-coolant.active { background: #0ea5e9; border-color: #0ea5e9; }
.ob3-pill-badge { background: rgba(255,255,255,.25); border-radius: 10px; padding: 1px 7px; font-size: 10.5px; }

.ob3-coolant-info {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding: 7px 10px;
  background: #f0f9ff; border-radius: 8px;
  border: 1px solid #bae6fd;
}
.ob3-date-field {
  border: 1.5px solid var(--border); border-radius: 6px;
  padding: 3px 7px; font-size: 12px; font-family: inherit;
}
.ob3-date-field:focus { outline: none; border-color: var(--blue); }

/* Filtry grid */
.ob3-filters-grid { display: flex; flex-direction: column; gap: 0; }

.ob3-filter-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 0;
  border-bottom: 1px solid var(--border-2);
  background: var(--surface);
  transition: background .12s;
}
.ob3-filter-row:last-child { border-bottom: none; }
.ob3-filter-row.ob3-filter-added { background: #f0fdf4; }

.ob3-filter-icon { font-size: 16px; width: 28px; text-align: center; flex-shrink: 0; }
.ob3-filter-info { flex: 1; min-width: 0; }
.ob3-filter-name { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.ob3-filter-part { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.ob3-filter-alt { color: var(--ink-3); margin-left: 4px; }
.ob3-filter-nodata { font-size: 11px; color: #aaa; font-style: italic; margin-top: 1px; }
.ob3-filter-qty { min-width: 44px; text-align: right; flex-shrink: 0; }
.ob3-filter-qty-val { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.ob3-filter-action { min-width: 70px; text-align: right; flex-shrink: 0; }
.ob3-filter-check { font-size: 11px; font-weight: 700; color: #16a34a; }

/* Kolumna 3 — podgląd */
.ob3-preview {
  background: #f0f2f6;
  padding: 0;
}
.ob3-preview-inner {
  padding: 16px;
  min-height: 100%;
}
.ob3-preview .pdf {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  padding: 20px 18px;
  font-size: 11px;
  line-height: 1.5;
}
.ob3-preview .pdf-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
}

/* ob3 w kontekście panel-inner — ważne! */
.panel-inner .ob3-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ob3-empty { padding: 20px 14px; color: var(--ink-3); font-size: 13px; text-align: center; }


/* offer_content musi wypełniać przestrzeń w .ob */
#offer_content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#offer_content .ob3-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

/* W panelu slide-over — ob3 musi zajmować całą dostępną wysokość */
.panel-inner .ob {
  width: 100%;
  max-width: none;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
}

/* ═══════════════════════════════════════════════════════
   SCARD — Karta zlecenia serwisanta
   ═══════════════════════════════════════════════════════ */
.scard {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px 22px;
  font-size: 12px;
  line-height: 1.6;
  color: #1a1a1a;
  font-family: inherit;
}

.scard-head {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 10px;
}
.scard-title-block { flex: 1; }
.scard-title { font-size: 14px; font-weight: 800; color: #111; }
.scard-nr { font-size: 12.5px; font-weight: 700; color: var(--blue-ink); margin-top: 2px; }

.scard-billing { font-size: 12px; margin-bottom: 12px; }
.scard-bill-active { font-weight: 800; color: #111; }
.scard-bill-crossed { text-decoration: line-through; color: #aaa; }
.scard-bill-sep { color: #aaa; }

.scard-grid2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px;
  margin-bottom: 12px;
}
.scard-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: #888; }
.scard-value { font-size: 12.5px; font-weight: 600; color: #111; }

.scard-divider { border: none; border-top: 1px solid #e5e7eb; margin: 10px 0; }

.scard-device { margin-bottom: 10px; }
.scard-device-name { font-size: 14px; font-weight: 800; color: #111; }
.scard-device-sub { font-size: 11px; color: #666; margin-top: 2px; }

.scard-section-title {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: #888; margin-bottom: 7px;
}

.scard-checklist { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.scard-check {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12px; color: #444; cursor: default;
}
.scard-check.checked { color: #111; font-weight: 600; }
.scard-box {
  width: 14px; height: 14px; border: 1.5px solid #ccc; border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff; background: #fff;
  flex-shrink: 0; margin-top: 1px;
}
.scard-check.checked .scard-box { background: var(--blue); border-color: var(--blue); }
.scard-check-note { font-size: 10.5px; color: #666; font-weight: 400; margin-left: 4px; }
.scard-dotline { color: #bbb; letter-spacing: 2px; }

.scard-contact { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.scard-contact-name { font-size: 13px; font-weight: 800; color: #111; }
.scard-contact-phone { font-size: 12.5px; font-weight: 700; color: var(--blue-ink); }

.scard-mat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.scard-mat-item { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; border-bottom: 1px solid #f3f4f6; }
.scard-mat-name { font-weight: 700; flex: 1; }
.scard-mat-part { font-size: 11px; color: #666; }
.scard-mat-qty { font-size: 11.5px; font-weight: 800; color: var(--blue-ink); min-width: 50px; text-align: right; }
.scard-empty-mat { color: #aaa; font-style: italic; font-size: 11.5px; }

.scard-footer {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-top: 16px; padding-top: 10px; border-top: 1px solid #e5e7eb;
  font-size: 11px; color: #555;
}

/* Karta serwisanta w podglądzie oferty (ob3-preview) */
.ob3-preview .scard { margin-top: 16px; font-size: 10.5px; }
.ob3-preview .scard-title { font-size: 12.5px; }
.ob3-preview .scard-device-name { font-size: 12.5px; }

/* Print — karta na osobnej stronie */
@media print {
  .scard { page-break-before: always; border: none; padding: 0; }
  .scard-box { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .scard-check.checked .scard-box { background: #2563eb !important; }
}

/* ── Poprawka layout ob3 — nadpisuje stare reguły ── */
.ob { display: flex; flex-direction: column; overflow: hidden; }
.ob #offer_content { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.ob #offer_content .ob3-wrap { flex: 1 1 auto; min-height: 0; }

/* panel-inner: .ob zajmuje 100% wysokości panelu */
.panel-inner .ob { width: 100% !important; max-width: none !important; height: 100% !important; border-radius: 0 !important; box-shadow: none !important; }

/* ob3-wrap grid — trzy kolumny, pełna wysokość */
.ob3-wrap { display: grid; grid-template-columns: 220px 1fr 42%; height: 100%; min-height: 0; overflow: hidden; }
.ob3-col { min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }

/* ═══════════════════════════════════════════════════════
   OB-PANEL — Offer Builder w wide panelu (v4)
   ═══════════════════════════════════════════════════════ */

/* Główny kontener — wypełnia panel-inner w 100% */
.ob-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

/* Nagłówek z gradientem */
.ob-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--grad);
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}

/* Pasek klienta */
.ob-panel-client {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}

/* Ciało — 3 kolumny */
.ob-panel-body {
  display: grid;
  grid-template-columns: 200px 1fr 38%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Każda kolumna scrolluje osobno */
.ob-panel-col {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ob-panel-col-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* Kolumna urządzeń */
.ob-panel-devices {
  background: var(--surface-2);
  border-right: 1px solid var(--border);
}

/* Karty urządzeń */
.ob-dcard {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: none;
  border-bottom: 1px solid var(--border-2);
  padding: 10px 10px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transition: background .12s;
}
.ob-dcard:hover { background: #f0f4ff; }
.ob-dcard.active { background: #eef3fe; border-left: 3px solid var(--blue); padding-left: 7px; }

.ob-dcard-check {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border);
  background: #fff;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800; color: #fff;
  flex-shrink: 0; margin-top: 2px;
}
.ob-dcard.active .ob-dcard-check { background: var(--blue); border-color: var(--blue); }
.ob-dcard-model { font-weight: 700; font-size: 12px; color: var(--ink); line-height: 1.3; }
.ob-dcard-sub { font-size: 10.5px; color: var(--ink-3); margin-top: 1px; }

/* Edytor — środkowa kolumna */
.ob-panel-editor {
  border-right: 1px solid var(--border);
}

/* offer_content wewnątrz ob-panel-editor */
.ob-panel-editor #offer_content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ob-editor-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Podgląd — prawa kolumna */
.ob-panel-preview {
  background: #f0f2f6;
}

.ob-preview-wrap {
  padding: 14px;
}
.ob-preview-wrap .pdf {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.09);
  padding: 18px 16px;
  font-size: 11px;
  line-height: 1.5;
}
.ob-preview-wrap .pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e7eb;
}

/* Stopka buildera */
.ob-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  gap: 16px;
}

/* overlay w kontekście panel-inner nie ma tła */
.panel-inner .overlay {
  position: static !important;
  inset: auto !important;
  background: none !important;
  backdrop-filter: none !important;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ob-panel-empty {
  padding: 20px 12px;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
  line-height: 1.6;
}

/* ob-panel-wrap — zastępuje .overlay w builderze (nie zamyka panelu przy kliknięciu) */
.ob-panel-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.panel-inner .ob-panel-wrap { height: 100%; }

/* Scroll środkowej kolumny buildera */
.ob-panel-editor { overflow-y: auto !important; }
.ob-editor-content { min-height: 0; }

/* Filtry predefiniowane — edytowalne wiersze */
.ob-filter-predef {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-2);
  flex-wrap: wrap;
}
.ob-filter-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.ob-filter-meta { flex: 1; min-width: 0; }
.ob-filter-name { font-weight: 700; font-size: 12.5px; }
.ob-filter-part { font-size: 11px; color: var(--ink-3); margin-left: 6px; }
.ob-filter-alt { color: var(--ink-3); }
.ob-filter-nodata { font-size: 11px; color: #aaa; font-style: italic; margin-left: 6px; }
.ob-filter-qty { font-size: 11.5px; font-weight: 700; color: var(--ink-2); min-width: 40px; text-align: right; flex-shrink: 0; }
.ob-filter-form { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 6px 0; width: 100%; }

/* Empty state */
.ob-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; padding: 40px; color: var(--ink-3); text-align: center;
}

/* ── Checkbox active w item_row ── */
.ob-item-cb {
  width: 22px; height: 22px; border-radius: 6px; border: none;
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
  flex-shrink: 0; cursor: pointer; transition: all .12s;
}
.ob-item-cb-on  { background: var(--blue); color: #fff; }
.ob-item-cb-off { background: var(--border); color: var(--ink-3); }
.ob-item-cb-gray { background: var(--surface-2); color: var(--ink-3); border: 1.5px solid var(--border); }

/* Nieaktywny wiersz — wyszarzony */
.ob-item-inactive { opacity: .45; }
.ob-name-inactive { text-decoration: line-through; color: var(--ink-3) !important; }
.ob-total-inactive { color: var(--ink-3) !important; }

/* Filter inline form — 1 wiersz %>*/
.ob-item-filter { background: #fafbff; gap: 6px; flex-wrap: wrap; }
.ob-filter-icon-sm { font-size: 15px; flex-shrink: 0; }

/* Empty state */
.ob-empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; padding: 40px;
  color: var(--ink-3); text-align: center; min-height: 200px;
}

/* Badge zlecenia w PDF preview */
.pdf-billing-badge {
  display: inline-block;
  font-size: 11px; font-weight: 800;
  background: #eef3fe; color: var(--blue-ink);
  border-radius: 6px; padding: 3px 10px;
  margin-bottom: 10px;
}

/* ── Billing pills bar ── */
.ob-billing-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.ob-billing-pill {
  padding: 5px 14px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 12px; font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.ob-billing-pill:hover { border-color: var(--blue); color: var(--blue-ink); }
.ob-billing-pill.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ── Scroll środkowej kolumny — fix ── */
.ob-panel-body {
  display: grid;
  grid-template-columns: 200px 1fr 38%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.ob-panel-col { overflow-y: auto; overflow-x: hidden; min-height: 0; }
.ob-panel-editor { overflow-y: auto !important; }
#offer_content { min-height: 0; }

/* ── Preview scroll ── */
.ob-panel-preview { overflow-y: auto; background: #f0f2f6; }
.ob-preview-wrap { padding: 14px; }

/* ── Item row checkbox ── */
.ob-item-cb {
  width: 22px; height: 22px; border-radius: 6px; border: none;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
  flex-shrink: 0; cursor: pointer; transition: all .12s;
}
.ob-item-cb-on  { background: var(--blue); color: #fff; }
.ob-item-cb-off { background: var(--border); color: var(--ink-3); }
.ob-item-cb-gray { background: var(--surface-2); color: var(--ink-3); border: 1.5px solid var(--border); }
.ob-item-inactive { opacity: .45; }
.ob-name-inactive { text-decoration: line-through; }
.ob-total-inactive { color: var(--ink-3) !important; }

/* ── Filter inline form ── */
.ob-item-filter { background: #fafbff; flex-wrap: wrap; gap: 5px; }

/* ═══════════════════════════════════════════════════════
   FIX SCROLL + ITEM ROW — nadpisuje wcześniejsze reguły
   ═══════════════════════════════════════════════════════ */

/* Środkowa kolumna — scroll */
.ob-panel-editor {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: block !important;
}
.ob-editor-scroll {
  min-height: 100%;
  padding-bottom: 20px;
}
#offer_content {
  display: block !important;
  min-height: 0;
}

/* Item row — jedna linia, nie wrap */
.ob-item {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  padding: 6px 14px !important;
  border-bottom: 1px solid var(--border-2) !important;
  min-height: 0 !important;
}
.ob-item .ob-name {
  min-width: 0;
  flex: 1 1 120px;
  font-size: 12.5px;
}
.ob-item .ob-num {
  flex-shrink: 0;
}
.ob-item .ob-total {
  flex-shrink: 0;
  min-width: 58px;
  text-align: right;
}
.ob-item .ob-x { flex-shrink: 0; }
.ob-item .ob-item-cb { flex-shrink: 0; }

/* Filter predef row też jedna linia */
.ob-item-filter {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 6px 14px !important;
  background: #fafbff !important;
}
.ob-item-filter input.ob-name { flex: 1 1 100px; min-width: 0; }
.ob-item-filter input.ob-num  { width: 72px !important; flex-shrink: 0; }

/* Billing pills — aktywna ma pełny kolor, nieaktywne wyszarzone */
.ob-billing-pill { transition: all .15s; }
.ob-billing-pill:not(.active) { opacity: .7; }

/* ═══════════════════════════════════════════════════════
   ITEM ROW — nowe klasy, jedna linia bez zawijania
   ═══════════════════════════════════════════════════════ */
.ob-name-field {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1.5px solid transparent;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
}
.ob-name-field:hover { border-color: var(--border); background: #fff; }
.ob-name-field:focus { outline: none; border-color: var(--blue); background: #fff; white-space: normal; }
.ob-name-inactive { text-decoration: line-through; color: var(--ink-3); }

.ob-num-field {
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 4px 5px;
  font-size: 12px;
  font-family: inherit;
  text-align: right;
}
.ob-num-field:focus { outline: none; border-color: var(--blue); }

.ob-unit-field {
  flex-shrink: 0;
  width: 38px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 4px 4px;
  font-size: 11px;
  font-family: inherit;
  text-align: center;
  color: var(--ink-2);
}
.ob-unit-field:focus { outline: none; border-color: var(--blue); }

.ob-total-field {
  flex-shrink: 0;
  width: 72px;
  text-align: right;
  font-weight: 800;
  font-size: 12.5px;
  color: var(--blue-ink);
}
.ob-total-inactive { color: var(--ink-3) !important; }

/* Item row — bezwzględnie jedna linia */
.ob-item {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 5px !important;
  padding: 5px 12px !important;
  border-bottom: 1px solid var(--border-2) !important;
  min-width: 0;
}
.ob-item form { display: contents !important; }

/* ═══════════════════════════════════════════════════════
   ACCORDION — separator między panelami + strzałka
   ═══════════════════════════════════════════════════════ */
.ob3-accordion {
  border: none !important;
  border-bottom: 2px solid var(--border) !important;
  margin-bottom: 2px;
  background: var(--surface);
}
.ob3-accordion + .ob3-accordion { border-top: none !important; }

/* Nagłówek sekcji — wyraźne tło */
.ob3-acc-head {
  background: var(--surface-2) !important;
  border-bottom: 1px solid var(--border-2);
  padding: 10px 14px !important;
}
.ob3-acc-head:hover { background: #eef3fe !important; }

/* Strzałka: ▶ zamknięte, ▼ otwarte */
.ob3-acc-chevron {
  font-size: 11px !important;
  color: var(--ink-3);
  transition: none !important;
  flex-shrink: 0;
}
details.ob3-accordion:not([open]) .ob3-acc-chevron::before { content: "▶"; }
details.ob3-accordion[open]       .ob3-acc-chevron::before { content: "▼"; }
details.ob3-accordion .ob3-acc-chevron { font-size: 0 !important; }
details.ob3-accordion .ob3-acc-chevron::before { font-size: 11px; }

/* Lewa niebieska kreska przy otwartym accordion */
details.ob3-accordion[open] {
  border-left: 3px solid var(--blue) !important;
}
details.ob3-accordion:not([open]) {
  border-left: 3px solid transparent !important;
}

/* Sekcja wewnątrz accordion — lekkie tło odróżniające */
.ob3-section {
  background: #fff;
  border-bottom: 1px solid #eef0f4;
  padding: 10px 14px 8px !important;
}
.ob3-section:last-child { border-bottom: none; }
.ob3-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #eef0f4;
}

/* 3 kolumny — separator pionowy */
.ob-panel-devices { border-right: 2px solid var(--border) !important; }
.ob-panel-editor  { border-right: 2px solid var(--border) !important; }

/* Filter predef row — jedna linia */
.ob-item-filter {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 5px 12px !important;
  background: #fafbff !important;
  border-bottom: 1px solid var(--border-2) !important;
}
.ob-item-filter input { flex-shrink: 0; }
.ob-item-filter .ob-name-field { flex: 1 1 80px; min-width: 0; }

/* Predef filter row — ikona zamiast checkboxa, reszta identyczna z ob-item */
.ob-item-predef { background: #f8faff !important; }
.ob-item-predef .ob-item-cb-gray {
  font-size: 15px !important;
  background: transparent !important;
  border: none !important;
  width: 22px; height: 22px;
  display: grid; place-items: center;
}

/* Predef bez danych — wyszarzone, mniejsze */
.ob-item-predef-nodata {
  opacity: .55;
}
.ob-item-predef-nodata .ob-name-field { color: var(--ink-3); }

/* Przycisk ＋ dodania predef */
.ob-add-predef {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 6px;
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .12s;
}
.ob-add-predef:hover { background: var(--blue-ink); }

/* Pills nad podglądem oferty */
.ob-preview-pills {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.ob-preview-pills-group {
  display: flex;
  align-items: center;
  gap: 5px;
}
.ob-preview-pills-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}
.ob3-pill-sm {
  padding: 3px 10px !important;
  font-size: 11px !important;
  border-radius: 14px !important;
}
/* ob-panel-preview jako flex column żeby pills były na górze */
.ob-panel-preview {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.ob-preview-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

/* Checkbox "dodaj" dla predefiniowanych filtrów — zielonkawy gdy ma dane */
.ob-item-cb-suggested {
  background: #e8f5e9;
  color: #2e7d32;
  border: 2px solid #a5d6a7;
  font-size: 13px;
  font-weight: 800;
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .12s;
}
.ob-item-cb-suggested:hover {
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
}

/* form jako flex item — żeby ob-item styles działały */
.ob-item-predef { display: flex !important; }
form.ob-item-predef { width: 100%; }

/* Pole nr katalogowego w predef filtrze */
.ob-part-field {
  flex: 1 1 0;
  min-width: 0;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11.5px;
  font-family: "Courier New", monospace;
  color: var(--ink-2);
  background: #f8faff;
}
.ob-part-field:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
}
.ob-part-field::placeholder { color: #bbb; font-style: italic; font-family: inherit; }

/* ── Builder locked states ── */
.ob-panel-body-locked .ob-panel-devices,
.ob-panel-body-locked .ob-panel-editor {
  opacity: .38;
  pointer-events: none;
  user-select: none;
  filter: grayscale(.4);
}
.ob-col-locked {
  opacity: .38;
  pointer-events: none;
  filter: grayscale(.4);
}

/* Komunikat gdy brak klienta / urządzenia */
.ob-locked-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 50px 30px;
  text-align: center;
  min-height: 200px;
}
.ob-locked-icon { font-size: 38px; margin-bottom: 14px; opacity: .6; }
.ob-locked-title { font-weight: 700; font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }
.ob-locked-sub { font-size: 13px; color: var(--ink-3); line-height: 1.5; }

/* Inline formularz nowego urządzenia w kolumnie buildera */
.ob-inline-form {
  border-bottom: 2px solid var(--blue);
  background: #f0f4ff;
  padding: 10px 10px 12px;
}
.ob-inline-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--blue-ink);
}
.ob-inline-errors {
  background: #fff0f0;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: #b91c1c;
  margin-bottom: 8px;
}
.ob-inline-fields {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ob-inline-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.ob-inline-input {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  width: 100%;
}
.ob-inline-input:focus { outline: none; border-color: var(--blue); }

/* Inline form urządzenia — override starych styli */
.ob-inline-form { padding: 8px; border-bottom: 2px solid var(--blue); background: #f0f4ff; }
.ob-inline-form-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; font-size:12px; font-weight:700; color:var(--blue-ink); }
.ob-inline-errors { background:#fff0f0; border:1px solid #fca5a5; border-radius:6px; padding:5px 8px; font-size:11px; color:#b91c1c; margin-bottom:6px; }
.ob-inline-row { display:flex; align-items:center; gap:6px; margin-bottom:4px; }
.ob-inline-lbl { font-size:10.5px; font-weight:700; color:var(--ink-3); width:72px; flex-shrink:0; text-align:right; }
.ob-inline-inp { flex:1; border:1.5px solid var(--border); border-radius:5px; padding:4px 6px; font-size:12px; font-family:inherit; background:#fff; min-width:0; }
.ob-inline-inp:focus { outline:none; border-color:var(--blue); }

/* Filter lookup */
.ob-lookup-btn {
  background: none; border: none; cursor: pointer;
  font-size: 14px; padding: 0 3px; opacity: .6;
  flex-shrink: 0; line-height: 1;
}
.ob-lookup-btn:hover { opacity: 1; }
.ob-lookup-btn:disabled { opacity: .3; cursor: wait; }

.ob-lookup-tooltip {
  position: absolute; z-index: 999;
  background: #1e293b; color: #fff;
  font-size: 11px; padding: 5px 10px;
  border-radius: 6px; margin-top: 2px;
  max-width: 280px; white-space: normal;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.ob-lookup-tooltip-error { background: #b91c1c; }

.ob-lookup-result {
  font-size: 11.5px; padding: 8px 12px;
  border-radius: 7px; line-height: 1.7;
}
.ob-lookup-result.ok { background: #f0fdf4; border: 1px solid #86efac; color: var(--ink); }
.ob-lookup-result.error { background: #fff0f0; border: 1px solid #fca5a5; color: #b91c1c; }
.ob-lookup-result code { font-family: monospace; background: rgba(0,0,0,.07); padding: 1px 4px; border-radius: 3px; }

/* Billing badge inline w podglądzie PDF */
.pdf-billing-inline {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #e8f4fd;
  color: #1565c0;
  border: 1px solid #90caf9;
  white-space: nowrap;
}

/* Filter Search Panel - sidebar nad builderem */
.ob-fs-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, .35);
  z-index: 9999;
  display: flex;
  justify-content: flex-end;
  animation: ob-fs-fade .15s ease-out;
}
@keyframes ob-fs-fade { from { opacity: 0 } to { opacity: 1 } }

.ob-fs-panel {
  width: min(540px, 100vw);
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 32px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  animation: ob-fs-slide .2s ease-out;
}
@keyframes ob-fs-slide { from { transform: translateX(20px) } to { transform: translateX(0) } }

.ob-fs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #eef3fe, #f8faff);
  flex-shrink: 0;
}

.ob-fs-search { padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ob-fs-input {
  flex: 1; padding: 8px 12px; font-size: 13px;
  border: 1.5px solid var(--border); border-radius: 8px; background: #fff;
}
.ob-fs-input:focus { outline: none; border-color: var(--blue); }

.ob-fs-list { flex: 1; overflow-y: auto; padding: 8px; }
.ob-fs-row { margin: 0 0 6px 0; }
.ob-fs-row-btn {
  width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  transition: all .12s;
}
.ob-fs-row-btn:hover { border-color: var(--blue); background: #f8faff; transform: translateY(-1px); }
.ob-fs-row-main { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.ob-fs-row-brand {
  font-size: 10px; font-weight: 800; color: var(--blue-ink);
  text-transform: uppercase; letter-spacing: .5px;
  background: #eef3fe; padding: 2px 6px; border-radius: 4px;
}
.ob-fs-row-model { font-weight: 700; font-size: 13px; color: var(--ink); }
.ob-fs-row-specs {
  display: flex; flex-wrap: wrap; gap: 8px 12px;
  font-size: 11px; color: var(--ink-2);
}
.ob-fs-row-filt code {
  font-family: monospace; font-size: 10.5px;
  background: rgba(0,0,0,.05); padding: 1px 4px; border-radius: 3px;
  color: var(--ink-2);
}

/* Nagłówek grupy filtrów (Filtr oleju, Filtr paliwa...) */
.ob-fg-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0 4px;
  font-size: 12px;
  color: var(--ink-2);
  border-top: 1px dashed var(--border);
  margin-top: 6px;
}
.ob-fg-head:first-child { border-top: none; margin-top: 0; padding-top: 4px; }

/* Filter Search Table — modal z tabelą silników */
.ob-fst-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: ob-fst-fade .15s ease-out;
}
@keyframes ob-fst-fade { from { opacity: 0 } to { opacity: 1 } }

.ob-fst-modal {
  width: 100%;
  max-width: 1400px;
  max-height: 90vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ob-fst-pop .2s ease-out;
}
@keyframes ob-fst-pop { from { transform: scale(.96); opacity: 0 } to { transform: scale(1); opacity: 1 } }

.ob-fst-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #eef3fe, #f8faff);
  flex-shrink: 0;
}

.ob-fst-toolbar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  flex-shrink: 0;
}
.ob-fst-search {
  flex: 1;
  padding: 9px 14px;
  font-size: 13.5px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.ob-fst-search:focus { outline: none; border-color: var(--blue); }

.ob-fst-table-wrap {
  flex: 1;
  overflow: auto;
  padding: 4px;
}
.ob-fst-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.ob-fst-table thead th {
  position: sticky; top: 0;
  background: #f1f5f9;
  padding: 9px 10px;
  text-align: left;
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--ink-3);
  border-bottom: 1.5px solid var(--border);
  z-index: 1;
}
.ob-fst-row td {
  padding: 8px 10px;
  vertical-align: top;
  border-bottom: 1px solid #f1f5f9;
}
.ob-fst-row:hover { background: #f8faff; }
.ob-fst-row:hover td { background: transparent; }

.ob-fst-brand {
  display: inline-block;
  font-size: 10px; font-weight: 800;
  color: var(--blue-ink);
  background: #eef3fe;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.ob-fst-part {
  font-family: monospace;
  font-size: 11px;
  background: rgba(0,0,0,.04);
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--ink);
}
.ob-fst-alt {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 2px;
  font-style: italic;
}
.ob-fst-qty {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--blue-ink);
}

.ob-fst-pick {
  background: linear-gradient(135deg, var(--blue), var(--blue-ink));
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s;
}
.ob-fst-pick:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(67,97,238,.3); }

/* Badge "z katalogu" przy grupach filtrów */
.ob-fg-source {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  color: #1976d2;
  background: #e3f2fd;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* ====== FIX: sidebar (.panel) NAD Leaflet z-index (2026-07-01) ====== */
/* Leaflet controls mają z-index 800, panes tile/marker/popup 200-700.
   .panel bez explicit z-index był pod nimi mimo position: fixed. */
.panel        { z-index: 1000 !important; }
.panel-scrim  { z-index: 999 !important; }
.panel-inner  { z-index: 1001 !important; }

/* Dodatkowo: kontener mapy Leaflet z z-index: 0 żeby jego wewnętrzne
   panes/controls (200-800) nie wystawały ponad inne fixed elementy. */
.leaflet-container { z-index: 0 !important; }

/* ====== Filter ekip w planerze: wyszarzenie zamiast ukrywania (2026-07-01) ====== */
/* Zwykłe elementy (cell kalendarza, sloty, asg, wiersze listy) - mocno wyszarzone i nieklikalne */
.is-crew-off {
  opacity: 0.28 !important;
  filter: grayscale(0.7);
  pointer-events: none !important;
  transition: opacity .2s ease, filter .2s ease;
}
/* Karta ekipy po prawej stronie - musi POZOSTAĆ klikalna aby można odkliknąć filtr */
.pl-crew-card.is-crew-off-card {
  opacity: 0.55 !important;
  filter: grayscale(0.4);
  /* pointer-events: auto zostawiamy - domyślne */
  transition: opacity .2s ease, filter .2s ease;
  position: relative;
}
/* Znacznik "wyłączono" na wyszarzonej karcie */
.pl-crew-card.is-crew-off-card::after {
  content: "🚫 Wyłączona · klik = włącz";
  position: absolute;
  top: 8px;
  right: 10px;
  background: #dc2626;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
  z-index: 2;
}

/* ====== FIX: ob-overlay (wybór klienta) NAD panelem oferty (2026-07-02) ====== */
.ob-overlay { z-index: 1100 !important; }
/* ====== FIX: crm-overlay NAD panelem oferty (2026-07-02) ====== */
.crm-overlay { z-index: 1100 !important; }


.sidebar-backdrop {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.3); z-index: 1001;
  opacity: 0; visibility: hidden; transition: all .3s;
}
.sidebar-backdrop.active {
  opacity: 1; visibility: visible;
}
