/* ============ PROREM CRM — style v2 „Modern” ============ */
:root {
  --green: #00913d;
  --green-2: #00b04a;
  --green-dark: #006b2d;
  --green-ink: #0a5c2c;
  --green-light: #e8f6ee;
  --ink: #16211a;
  --muted: #74807a;
  --line: #e6ebe8;
  --bg: #f4f7f5;
  --card: #ffffff;
  --red: #d64541;
  --amber: #c07f00;
  --blue: #2470a8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(22, 33, 26, .04), 0 8px 24px -8px rgba(22, 33, 26, .10);
  --shadow-lg: 0 2px 6px rgba(22, 33, 26, .06), 0 18px 40px -12px rgba(22, 33, 26, .18);
  --ring: 0 0 0 3px rgba(0, 176, 74, .18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 13.5px; color: var(--ink); }
::selection { background: rgba(0, 176, 74, .22); }

/* delikatny scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c9d4cd; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #a9b8af; }

/* ---------- LOGIN ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
  background: radial-gradient(1200px 700px at 15% -10%, #0f5c31 0%, transparent 60%),
              radial-gradient(1000px 800px at 110% 110%, #00b04a 0%, transparent 55%),
              linear-gradient(150deg, #081f12 0%, #0d3a20 45%, #0f6b37 100%);
}
.login-wrap::before, .login-wrap::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .35; pointer-events: none;
}
.login-wrap::before { width: 480px; height: 480px; background: #00d15a; top: -160px; right: -120px; }
.login-wrap::after { width: 420px; height: 420px; background: #06371d; bottom: -140px; left: -100px; }
.login-card {
  position: relative; z-index: 1;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 24px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55);
  width: 100%; max-width: 410px; padding: 42px 42px 34px;
  animation: cardIn .5s cubic-bezier(.2, .8, .25, 1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.login-card .logo { display: block; margin: 0 auto 8px; max-width: 210px; }
.login-card .sub {
  text-align: center; color: var(--muted); font-size: 12px; font-weight: 600;
  letter-spacing: 4px; text-transform: uppercase; margin-bottom: 30px;
}
.login-card label { display: block; font-size: 12px; font-weight: 600; color: #4a554f; margin: 15px 0 6px; }
.login-card input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 14px;
  background: #fbfdfc; transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-card input:focus { outline: none; border-color: var(--green-2); background: #fff; box-shadow: var(--ring); }
.login-card .btn-login {
  width: 100%; margin-top: 26px; padding: 13px; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, var(--green-2), var(--green-dark));
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .2px;
  box-shadow: 0 10px 24px -8px rgba(0, 145, 61, .65);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.login-card .btn-login:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 14px 30px -8px rgba(0, 145, 61, .7); }
.login-card .btn-login:active { transform: translateY(0); }
.login-error {
  margin-top: 14px; padding: 11px 13px; border-radius: 10px; font-size: 13px;
  background: #fdecec; color: var(--red); border: 1px solid #f6cfce; display: none;
}
.login-foot { text-align: center; color: #93a09a; font-size: 11px; margin-top: 26px; }
.login-foot a { color: #00913d; font-weight: 600; text-decoration: none; }
.login-foot a:hover { text-decoration: underline; }

/* ---------- SHELL ---------- */
#app { display: none; min-height: 100vh; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: 0 0 248px;
  background: linear-gradient(180deg, #0b2415 0%, #0e3520 70%, #0f3d24 100%);
  color: #c8dcd0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  background: #fff; margin: 18px 16px 10px; border-radius: 14px; padding: 12px 14px; text-align: center;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5);
}
.sidebar .brand img { max-width: 148px; display: inline-block; }
.nav { flex: 1; overflow-y: auto; padding: 10px 14px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; margin: 3px 0; border-radius: 11px;
  color: #a9c4b3; text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s, transform .1s;
}
.nav a .ico { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 20px; }
.nav a .ico svg { width: 18px; height: 18px; stroke-width: 1.9; opacity: .8; transition: opacity .15s, transform .15s; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a:hover .ico svg { opacity: 1; transform: scale(1.08); }
.nav a.active {
  background: linear-gradient(135deg, var(--green-2), #007a34);
  color: #fff; font-weight: 600;
  box-shadow: 0 8px 18px -6px rgba(0, 176, 74, .55);
}
.nav a.active .ico svg { opacity: 1; }
.sidebar .userbox {
  margin: 12px 14px 16px; padding: 13px 14px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px; font-size: 12.5px;
}
.sidebar .userbox .uname { color: #fff; font-weight: 600; }
.sidebar .userbox .urole { color: #7fa88f; font-size: 11.5px; margin: 2px 0 10px; }
.btn-logout {
  width: 100%; padding: 8px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 9px;
  background: transparent; color: #c8dcd0; font-size: 12.5px; font-weight: 600;
  transition: background .15s, color .15s;
}
.btn-logout:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.main { flex: 1; min-width: 0; padding: 28px 34px 70px; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.page-head .crumbs { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- COMPONENTS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 17px; border-radius: 11px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none;
  box-shadow: 0 1px 2px rgba(22, 33, 26, .05);
  transition: border-color .15s, color .15s, transform .12s, box-shadow .15s, background .15s;
}
.btn:hover { border-color: #bfd8c9; color: var(--green-ink); transform: translateY(-1px); box-shadow: 0 4px 10px -2px rgba(22, 33, 26, .12); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--green-2), var(--green-dark));
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px -6px rgba(0, 145, 61, .55);
}
.btn.primary:hover { filter: brightness(1.06); color: #fff; box-shadow: 0 10px 22px -6px rgba(0, 145, 61, .6); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: #ecb7b5; background: #fdf1f0; color: var(--red); }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 8px; }

.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid rgba(230, 235, 232, .8);
  box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden;
}
.card .card-title {
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .9px; color: var(--green-ink);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #fbfdfc, #f6faf7);
}
.card .card-title > span:first-child { display: inline-flex; align-items: center; gap: 9px; }
.card .card-title > span:first-child::before {
  content: ""; width: 4px; height: 15px; border-radius: 4px;
  background: linear-gradient(180deg, var(--green-2), var(--green-dark));
}
.card .card-body { padding: 20px; }
.card .card-body h4 { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: #33403a; }

/* KPI */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi {
  position: relative; background: #fff; border-radius: var(--radius);
  border: 1px solid rgba(230, 235, 232, .8);
  box-shadow: var(--shadow); padding: 18px 20px; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 5px;
  background: linear-gradient(180deg, var(--green-2), var(--green-dark));
  border-radius: 0 4px 4px 0;
}
.kpi::after {
  content: ""; position: absolute; width: 130px; height: 130px; border-radius: 50%;
  right: -55px; top: -55px; background: radial-gradient(circle, rgba(0, 176, 74, .09), transparent 70%);
}
.kpi .k-label { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 700; }
.kpi .k-value { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-top: 7px; }
.kpi .k-extra { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.red::before { background: linear-gradient(180deg, #e5605c, #b53430); }
.kpi.red::after { background: radial-gradient(circle, rgba(214, 69, 65, .1), transparent 70%); }
.kpi.amber::before { background: linear-gradient(180deg, #e3a008, #9a6600); }
.kpi.amber::after { background: radial-gradient(circle, rgba(192, 127, 0, .1), transparent 70%); }
.kpi.blue::before { background: linear-gradient(180deg, #3d94d4, #1b5a88); }
.kpi.blue::after { background: radial-gradient(circle, rgba(36, 112, 168, .1), transparent 70%); }

/* Tables */
.tbl-wrap { overflow-x: auto; margin: -6px; padding: 6px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; padding: 10px 12px; background: transparent; color: #8a968f;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; white-space: nowrap; font-weight: 700;
  border-bottom: 1.5px solid var(--line);
}
.tbl td { padding: 12px; border-bottom: 1px solid #eef2ef; vertical-align: top; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #f5faf7; }
.tbl tr.clickable { cursor: pointer; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .empty { text-align: center; color: var(--muted); padding: 34px; }

/* Badges */
.badge {
  display: inline-block; padding: 3.5px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: #eef1ef; color: #5c6862; border: 1px solid transparent;
}
.badge.green { background: #e2f5ea; color: #086b34; border-color: #c3e8d2; }
.badge.red { background: #fdecec; color: #b53430; border-color: #f4cbca; }
.badge.amber { background: #fcf3df; color: #9a6600; border-color: #f1e0b7; }
.badge.blue { background: #e6f0f8; color: #1b5a88; border-color: #c8def0; }
.badge.gray { background: #efefef; color: #666; border-color: #e0e0e0; }

/* Progress */
.prog { background: #e8ece9; border-radius: 20px; height: 8px; min-width: 90px; overflow: hidden; }
.prog > i {
  display: block; height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, var(--green-2), var(--green-dark));
  box-shadow: 0 0 8px rgba(0, 176, 74, .5);
  transition: width .4s ease;
}

/* Forms */
.frm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; }
.frm-grid .full { grid-column: 1 / -1; }
.f-field label { display: block; font-size: 11.5px; font-weight: 600; color: #5c6862; margin-bottom: 5px; }
.f-field input, .f-field select, .f-field textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fbfdfc;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.f-field textarea { min-height: 68px; resize: vertical; }
.f-field input:focus, .f-field select:focus, .f-field textarea:focus {
  outline: none; border-color: var(--green-2); background: #fff; box-shadow: var(--ring);
}
.f-field input[readonly] { background: #f1f4f2; color: #5c6862; font-weight: 600; }
.chk-row { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; padding-top: 6px; }
.chk-row label { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; font-weight: 500; }
.chk-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; }

/* Dynamic tables (editable) */
table.dyn { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dyn th {
  text-align: left; background: transparent; padding: 7px 7px; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .6px; color: #8a968f; font-weight: 700;
  border-bottom: 1.5px solid var(--line); white-space: nowrap;
}
.dyn td { padding: 4px 3px; border-bottom: 1px solid #eef2ef; }
.dyn input, .dyn select {
  width: 100%; padding: 7px 8px; border: 1.5px solid transparent; border-radius: 8px; background: transparent;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.dyn input:hover, .dyn select:hover { border-color: var(--line); background: #fff; }
.dyn input:focus, .dyn select:focus { outline: none; border-color: var(--green-2); background: #fff; box-shadow: var(--ring); }
.dyn .rm { border: 0; background: none; color: #c3ccc7; font-size: 15px; padding: 2px 7px; border-radius: 6px; transition: color .12s, background .12s; }
.dyn .rm:hover { color: var(--red); background: #fdf1f0; }
.dyn tfoot td { font-weight: 700; padding: 9px 8px; background: #f6faf7; color: var(--green-ink); border-radius: 0 0 8px 8px; }
.add-row { margin-top: 10px; }
.dyn .row-ctl { white-space: nowrap; text-align: right; }
.dyn .mv { border: 0; background: none; color: #b5c0ba; font-size: 11px; padding: 3px 5px; border-radius: 6px; transition: color .12s, background .12s; }
.dyn .mv:hover { color: var(--green-ink); background: var(--green-light); }
.dyn .dyn-wynik { padding: 7px 8px; font-weight: 600; color: #33403a; white-space: nowrap; }
.rob-sum { margin-top: 16px; padding: 11px 14px; border-radius: 10px; background: var(--green-light); color: var(--green-ink); font-size: 13px; }

.sect-note { font-size: 12.5px; color: var(--muted); margin: -4px 0 14px; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

/* Wariant box */
.wariant {
  position: relative;
  border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px;
  background: linear-gradient(180deg, #fbfdfc, #f8fbf9);
  box-shadow: 0 1px 3px rgba(22, 33, 26, .04);
}
.wariant::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; border-radius: 4px 0 0 4px;
  background: linear-gradient(180deg, var(--green-2), var(--green-dark));
}
.wariant .w-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.wariant .w-head b { color: var(--green-ink); font-size: 14px; }

/* Toolbar / search */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=search], .toolbar select {
  padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 11px; background: #fff; min-width: 200px;
  box-shadow: 0 1px 2px rgba(22, 33, 26, .05);
  transition: border-color .15s, box-shadow .15s;
}
.toolbar input[type=search]:focus, .toolbar select:focus { outline: none; border-color: var(--green-2); box-shadow: var(--ring); }

/* Toast */
#toast {
  position: fixed; bottom: 26px; right: 26px; z-index: 999;
  background: #1c2a21; color: #fff; padding: 13px 20px; border-radius: 13px; font-size: 13.5px; font-weight: 500;
  box-shadow: 0 14px 34px -8px rgba(0, 0, 0, .45); display: none;
  animation: toastIn .25s cubic-bezier(.2, .8, .25, 1);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#toast.green { background: linear-gradient(135deg, #0a7c39, #06542a); }

/* Compare strip (serwis / kosztorys) */
.cmp-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.cmp-box {
  border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px; background: #fbfdfc;
  transition: transform .15s, box-shadow .15s;
}
.cmp-box:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(22, 33, 26, .14); }
.cmp-box .c-l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 700; }
.cmp-box .c-v { font-size: 19px; font-weight: 800; letter-spacing: -.3px; margin-top: 5px; }
.cmp-box.good { background: #f2fbf6; border-color: #cfe9da; }
.cmp-box.good .c-v { color: var(--green-dark); }
.cmp-box.bad { background: #fdf5f5; border-color: #f0d4d3; }
.cmp-box.bad .c-v { color: var(--red); }

/* Pole z przyciskiem obok (np. klient + „Nowy”) */
.inline-row { display: flex; gap: 8px; align-items: stretch; }
.inline-row select { flex: 1; min-width: 0; }
.inline-row .btn { white-space: nowrap; }

/* Wbudowany formularz nowego klienta na karcie oferty */
.nk-box {
  border: 1.5px dashed #bfd8c9; border-radius: 12px; padding: 16px;
  background: #f7fbf8;
}
.nk-box > b { color: var(--green-ink); font-size: 13px; }

/* ---------- Kalendarz (skrócony Gantt) ---------- */
.gantt { overflow-x: auto; }
.g-row { display: flex; align-items: stretch; border-bottom: 1px solid #eef2ef; min-height: 40px; }
.g-row:last-child { border-bottom: 0; }
.g-row.clickable { cursor: pointer; transition: background .12s; }
.g-row.clickable:hover { background: #f5faf7; }
.g-label {
  flex: 0 0 250px; padding: 11px 14px 11px 0; font-size: 12.5px; font-weight: 600; color: #33403a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.g-label .g-typ {
  display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .7px;
  color: var(--muted); font-weight: 700;
}
.g-track { flex: 1; position: relative; min-width: 420px; }
.g-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); opacity: .5; z-index: 2; }
.g-head { border-bottom: 1.5px solid var(--line); min-height: 28px; }
.g-head .g-label { padding: 0; }
.g-month {
  position: absolute; top: 6px; padding-left: 7px; white-space: nowrap;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: #8a968f; font-weight: 700;
}
.g-bar {
  position: absolute; top: 50%; transform: translateY(-50%); height: 14px; min-width: 6px; border-radius: 8px;
  background: linear-gradient(90deg, var(--green-2), var(--green-dark));
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, .35); z-index: 1;
}
.g-bar.blue { background: linear-gradient(90deg, #3d94d4, #1b5a88); }
.g-bar.open { border-radius: 8px 2px 2px 8px; opacity: .9; }
.g-mile {
  position: absolute; top: 50%; width: 12px; height: 12px; z-index: 1;
  transform: translate(-50%, -50%) rotate(45deg); border-radius: 3px;
  background: #e3a008; box-shadow: 0 2px 6px -2px rgba(0, 0, 0, .4);
}
.g-mile.blue { background: #3d94d4; }
.g-mile.late { background: var(--red); }

.placeholder-box { text-align: center; padding: 70px 20px; color: var(--muted); }
.placeholder-box .big { font-size: 44px; margin-bottom: 14px; }
.placeholder-box p { font-size: 15px; }

/* Modal potwierdzenia (Tak / Nie) */
#modal-overlay {
  position: fixed; inset: 0; background: rgba(16, 28, 21, .48); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
#modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: 16px; padding: 26px 28px; max-width: 430px; width: 100%;
  box-shadow: 0 24px 70px -18px rgba(0, 0, 0, .35); animation: modalIn .18s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-box h3 { margin: 0 0 10px; font-size: 17px; letter-spacing: -.2px; }
.modal-box p { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Kafelki akcji na pulpicie (klikalne, działają jak filtr) ---------- */
.kpi.act { cursor: pointer; user-select: none; }
.kpi.act:hover { border-color: #bfd8c9; }
.kpi.act.sel {
  border-color: var(--green-2);
  box-shadow: var(--ring), var(--shadow-lg);
}
.kpi.act.sel .k-value { color: var(--green-dark); }
.kpi .k-extra .prog { margin-top: 6px; }

/* ---------- Duży pasek stanu realizacji (karta zlecenia) ---------- */
.prog-big { margin-bottom: 18px; }
.prog-big .pb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; }
.prog-big .pb-head b { font-size: 15px; color: var(--green-ink); }
.prog-big .pb-head span { font-size: 12px; color: var(--muted); }
.prog-big .prog { height: 12px; }
.prog-big .pb-warn {
  margin-top: 10px; font-size: 12.5px; line-height: 1.5; color: #9a6600;
  background: #fcf3df; border: 1px solid #f1e0b7; border-radius: 10px; padding: 10px 12px;
}

/* pole oznakowań przy użytkowniku */
.grp-inp {
  width: 100%; min-width: 150px; padding: 6px 9px; border: 1px solid var(--line);
  border-radius: 8px; background: #fbfdfc;
}
.grp-inp:focus { outline: none; border-color: var(--green-2); background: #fff; box-shadow: var(--ring); }

/* ---------- Raport z wykonanych prac (wydruk / PDF) ---------- */
.report {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 38px; max-width: 900px; box-shadow: var(--shadow); color: #16211a;
}
.report .r-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--green); padding-bottom: 14px; }
.report .r-head img { max-width: 190px; }
.report .r-tit { text-align: right; }
.report .r-tit h2 { font-size: 18px; letter-spacing: .4px; }
.report .r-tit div { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.report .r-meta { width: 100%; border-collapse: collapse; margin: 20px 0 6px; }
.report .r-meta th, .report .r-meta td { border: 1px solid var(--line); padding: 7px 10px; font-size: 12.5px; text-align: left; vertical-align: top; }
.report .r-meta th { width: 220px; background: #f6faf7; font-weight: 600; color: #33403a; }
.report .r-sect { margin-top: 20px; break-inside: avoid; }
.report .r-sect h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--green-ink);
  border-bottom: 1px solid var(--line); padding-bottom: 5px; margin-bottom: 9px;
}
.report .r-sect p { font-size: 13px; line-height: 1.6; }
.report .r-tbl { width: 100%; border-collapse: collapse; }
.report .r-tbl th, .report .r-tbl td { border: 1px solid var(--line); padding: 6px 9px; font-size: 12px; text-align: left; }
.report .r-tbl thead th { background: #f6faf7; font-weight: 600; }
.report .r-tbl tfoot td { background: #f6faf7; font-weight: 700; }
.report .r-tbl .num { text-align: right; white-space: nowrap; }
.report .r-sign { display: flex; gap: 60px; margin-top: 54px; font-size: 12px; color: #33403a; break-inside: avoid; }
.report .r-sign > div { flex: 1; text-align: center; }
.report .r-sign .r-line { border-top: 1px solid #8a968f; margin-bottom: 7px; }
.report .r-foot { margin-top: 26px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); text-align: center; }

/* karta (oferta, partner, zlecenie, przetarg, umowa): pasek z tytułem i „Zapisz” zostaje u góry przy przewijaniu */
.main.karta .page-head {
  position: sticky; top: 0; z-index: 30;
  margin: -28px -34px 22px; padding: 14px 34px;
  background: rgba(244, 247, 245, .94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
/* bloki karty na przemian jasne / ciemne */
.main.karta .card.alt { background: #f1f6f3; border-color: #d9e6de; }
.main.karta .card.alt > .card-title { background: linear-gradient(135deg, #0e3520, #15502f); color: #fff; border-bottom-color: #0e3520; }
.main.karta .card.alt > .card-title > span:first-child::before { background: linear-gradient(180deg, #7fe0a7, var(--green-2)); }
.main.karta .card.alt .f-field input, .main.karta .card.alt .f-field select, .main.karta .card.alt .f-field textarea { background: #fff; }
.main.karta .card.alt .dyn tfoot td { background: #e4efe8; }

@media (max-width: 900px) {
  .main.karta .page-head { margin: -18px -18px 18px; padding: 12px 18px; }
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .nav { display: flex; flex-wrap: wrap; }
  .main { padding: 18px; }
}
@media print {
  .sidebar, .page-head .toolbar, .btn, #toast, .no-print { display: none !important; }
  .main { padding: 0; }
  body { background: #fff; }
  .card, .kpi { box-shadow: none; border: 1px solid #ccc; }
  /* raport dla klienta — czysta kartka A4 bez ramek aplikacji */
  .report { border: 0; border-radius: 0; box-shadow: none; padding: 0; max-width: none; }
  .report .r-sect, .report .r-tbl tr { break-inside: avoid; }
}
@page { size: A4; margin: 14mm 12mm; }

/* tryb podglądu (rola z uprawnieniem P) */
.podglad-info { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: #e9f2f9; color: var(--blue); font-size: 13.5px; font-weight: 600; }
main input:disabled, main select:disabled, main textarea:disabled { background: #f6f8f7; color: var(--ink); cursor: default; opacity: 1; }

/* logowanie — krok 2: kod z maila */
.kod-info { font-size: 13px; color: #4a554f; line-height: 1.55; margin: 0 0 4px; text-align: center; }
.login-card .kod-input { font-size: 24px; letter-spacing: 8px; text-align: center; font-weight: 700; }
.kod-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--green); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: #a9b3ae; cursor: default; text-decoration: none; }
.kod-hint { text-align: center; color: #93a09a; font-size: 11.5px; margin: 14px 0 0; }
.login-ok {
  margin-top: 14px; padding: 11px 13px; border-radius: 10px; font-size: 13px;
  background: var(--green-light); color: var(--green-ink); border: 1px solid #c6e8d3; display: none;
}

/* ostrzeżenie przed automatycznym wylogowaniem */
#idle-overlay {
  position: fixed; inset: 0; background: rgba(16, 28, 21, .48); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 1100; padding: 20px;
}
#idle-overlay.open { display: flex; }
