/* Abrys Projekty – motyw: czarne tło, biały tekst, Calibri */
:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #0e0e0e;
  --surface-2: #161616;
  --surface-3: #1e1e1e;
  --border: #262626;
  --border-strong: #3a3a3a;
  --text: #ffffff;
  --text-2: #d6d6d6;
  --muted: #8f8f8f;
  --accent: #ffffff;
  --accent-ink: #000000;
  --accent-soft: rgba(255, 255, 255, .08);
  --danger: #ff6b5e;
  --danger-bg: rgba(255, 107, 94, .13);
  --warn: #f2b24c;
  --warn-bg: rgba(242, 178, 76, .13);
  --ok: #5fd08a;
  --ok-bg: rgba(95, 208, 138, .12);
  --info: #7fb2ff;
  --info-bg: rgba(127, 178, 255, .12);
  --violet: #b59cff;
  --violet-bg: rgba(181, 156, 255, .13);
  --st-koncepcja: #8f6fe0;
  --st-PB: #3f84d8;
  --st-PW: #1fa5a5;
  --st-nadzor: #d8962e;
  --radius: 8px;
  font-family: Calibri, Carlito, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { margin: 0; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
h1 { font-size: 26px; margin: 0; font-weight: 700; letter-spacing: .01em; }
h2 { font-size: 17px; margin: 0; font-weight: 700; }
small, .muted { color: var(--muted); }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
::selection { background: #fff; color: #000; }

/* ---------- logo ---------- */
.logo-img { display: block; max-width: 100%; height: auto; }
.logo-text { font-weight: 700; letter-spacing: .28em; font-size: 22px; color: #fff; }
.brand-sub { display: block; font-size: 11.5px; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

/* ---------- logowanie ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: #000; }
.login-box { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand .logo-img { max-width: 240px; max-height: 90px; margin: 0 auto; }
.login-brand .logo-text { font-size: 34px; }
.login-box label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 13px; color: var(--text-2); }

/* ---------- układ ---------- */
#app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: #000; border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 26px 22px 24px; }
.brand .logo-img { max-width: 150px; max-height: 46px; }
#nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; flex: 1; overflow-y: auto; }
#nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 6px; color: var(--muted); font-weight: 700; text-decoration: none; position: relative; }
#nav a:hover { color: #fff; background: var(--surface-2); }
#nav a.active { color: #fff; background: var(--surface-3); }
#nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; background: #fff; border-radius: 0 3px 3px 0; }
#nav svg { width: 18px; height: 18px; flex: none; }
#nav .nav-sep { height: 1px; background: var(--border); margin: 10px 6px; }
.side-foot { padding: 16px 18px; border-top: 1px solid var(--border); }
.me { display: flex; gap: 10px; align-items: center; }
.me b { display: block; font-weight: 700; }
.me small { color: var(--muted); }
.side-links { display: flex; gap: 16px; margin-top: 12px; font-size: 13.5px; }
.side-links a { color: var(--muted); text-decoration: none; }
.side-links a:hover { color: #fff; }
main { padding: 30px 36px 60px; min-width: 0; max-width: 1520px; }

.avatar { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #000; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 700; flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ---------- przyciski / formularze ---------- */
.btn { border: 1px solid var(--border-strong); background: transparent; color: #fff; padding: 7px 14px; border-radius: 6px;
  font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-3); border-color: #555; }
.btn.primary { background: #fff; border-color: #fff; color: #000; }
.btn.primary:hover { background: #d9d9d9; border-color: #d9d9d9; }
.btn.danger { color: var(--danger); border-color: rgba(255, 107, 94, .4); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.sm { padding: 3px 9px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-3); color: #fff; }

input, select, textarea { font: inherit; color: #fff; border: 1px solid var(--border-strong); border-radius: 6px; padding: 7px 10px;
  background: #0a0a0a; width: 100%; min-width: 0; }
input::placeholder, textarea::placeholder { color: #666; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(255, 255, 255, .25); outline-offset: 0; border-color: #fff; }
select option { background: #111; color: #fff; }
textarea { resize: vertical; }
input[type=checkbox] { width: auto; accent-color: #fff; }
.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 400; cursor: pointer; white-space: nowrap; color: var(--text-2); }
.form-error { color: var(--danger); font-size: 14px; }
.form-error:empty { display: none; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input[type=search] { max-width: 330px; }
.filters select, .filters input[type=date] { width: auto; max-width: 250px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 7px 13px; font: inherit; cursor: pointer; color: var(--muted); font-weight: 700; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button:hover { color: #fff; }
.seg button.on { background: #fff; color: #000; }

/* ---------- karty / siatki ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.card-head a { font-size: 14px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid2 .full { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 18px; color: #fff; text-decoration: none; }
a.stat:hover { border-color: #555; }
.stat b { display: block; font-size: 32px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat span { color: var(--muted); font-size: 14px; }
.stat.warn b { color: var(--danger); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 14px 24px; margin-bottom: 16px; }
.info-grid div > span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 3px; }
.info-grid .wide { grid-column: 1 / -1; white-space: pre-wrap; }

/* ---------- tabele ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 700; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  padding: 11px 12px; border-bottom: 1px solid var(--border); background: #0a0a0a; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-open], tbody tr[data-href] { cursor: pointer; }
tbody tr[data-open]:hover, tbody tr[data-href]:hover { background: var(--surface-2); }
tfoot td { font-weight: 700; background: #0a0a0a; border-top: 1px solid var(--border); border-bottom: 0; }
td small { display: block; }
tr.row-late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.card:not(.flush) .table-wrap { margin: 0 -20px -18px; }
.card:not(.flush) .table-wrap th:first-child, .card:not(.flush) .table-wrap td:first-child { padding-left: 20px; }

/* ---------- odznaki ---------- */
.badge { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2); border: 1px solid transparent; }
.badge.stage { color: #fff; }
.st-koncepcja { background: var(--st-koncepcja) !important; }
.st-PB { background: var(--st-PB) !important; }
.st-PW { background: var(--st-PW) !important; }
.st-nadzor { background: var(--st-nadzor) !important; }
.b-aktywny, .b-w_toku, .b-zlozony, .b-rozpatrywany { background: var(--info-bg); color: var(--info); }
.b-zakonczony, .b-zrobione, .b-uzyskany { background: var(--ok-bg); color: var(--ok); }
.b-wstrzymany, .b-uzupelnienie, .b-do_sprawdzenia { background: var(--warn-bg); color: var(--warn); }
.b-oferta, .b-przygotowanie { background: var(--violet-bg); color: var(--violet); }
.b-odmowa { background: var(--danger-bg); color: var(--danger); }
.b-admin { background: #fff; color: #000; }
.prio { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: #555; vertical-align: 1px; }
.prio-wysoki { background: var(--danger); }
.prio-normalny { background: #9a9a9a; }
.due { white-space: nowrap; }
.due small { display: inline; color: inherit; opacity: .85; }
.due.late { color: var(--danger); font-weight: 700; }
.due.soon { color: var(--warn); font-weight: 700; }

/* ---------- listy na pulpicie ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); cursor: pointer; }
.list li:first-child { border-top: 0; }
.list li:hover .li-title { text-decoration: underline; text-underline-offset: 3px; }
.list .li-title { font-weight: 700; }
.list small { display: block; margin-top: 2px; }
.list .li-right { text-align: right; flex: none; }

.weekbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 180px; align-items: end; }
.wb { display: flex; flex-direction: column; align-items: center; height: 100%; gap: 4px; }
.wb-bar { flex: 1; width: 100%; max-width: 38px; background: var(--surface-2); border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; }
.wb-bar span { width: 100%; background: #fff; border-radius: 4px 4px 0 0; }
.wb-val { font-size: 13px; font-weight: 700; min-height: 17px; }
.wb-day { font-size: 13px; color: var(--muted); }
.wb.today .wb-day { color: #fff; font-weight: 700; }

.hbar { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; padding: 6px 0; }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; border-radius: 99px; background: #fff; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.mini { height: 4px; background: var(--surface-3); border-radius: 9px; margin-top: 4px; overflow: hidden; min-width: 60px; }
.mini span { display: block; height: 100%; background: #fff; }
.mini span.over { background: var(--danger); }

/* ---------- projekt ---------- */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.step { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 11px 13px; font: inherit; text-align: left;
  cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--muted); }
.step:hover { border-color: #555; color: #fff; }
.step-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 12px; font-weight: 700; flex: none; }
.step.done { color: var(--text-2); }
.step.done .step-n { background: var(--ok-bg); color: var(--ok); }
.step.current { border-color: #fff; color: #fff; background: var(--surface-2); }
.step.current .step-n { background: #fff; color: #000; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { border: 0; background: none; font: inherit; padding: 10px 15px; cursor: pointer; color: var(--muted); font-weight: 700;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: #fff; }
.tabs button.on { color: #fff; border-bottom-color: #fff; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.kcol { background: #090909; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 220px; transition: background .15s; }
.kcol.over { background: var(--surface-2); outline: 2px dashed #fff; }
.kcol-head { display: flex; justify-content: space-between; font-weight: 700; padding: 2px 4px 10px; }
.kcol-head span { color: var(--muted); }
.kcard { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; }
.kcard:hover { border-color: #555; }
.kcard.dragging { opacity: .4; }
.kcard .kt { font-weight: 700; margin-bottom: 4px; }
.kcard .km { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.kcard.p-wysoki { border-left: 3px solid var(--danger); }
.kdrop { color: var(--muted); font-size: 13.5px; text-align: center; padding: 30px 8px; border: 1px dashed var(--border-strong); border-radius: 6px; }

/* ---------- harmonogram ---------- */
.gantt { overflow-x: auto; }
.g-inner { min-width: 900px; }
.g-row { display: grid; grid-template-columns: 250px 1fr; border-bottom: 1px solid var(--border); }
.g-row:last-child { border-bottom: 0; }
.g-label { padding: 9px 14px; border-right: 1px solid var(--border); overflow: hidden; }
.g-label a { font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.g-label a:hover { text-decoration: underline; }
.g-label small { white-space: nowrap; }
.g-track { position: relative; min-height: 50px; }
.g-head { background: #0a0a0a; }
.g-head .g-track { display: flex; min-height: 0; }
.g-month { border-left: 1px solid var(--border); font-size: 13px; color: var(--muted); padding: 9px 6px; white-space: nowrap; overflow: hidden; }
.g-month.now { color: #fff; font-weight: 700; }
.g-grid { position: absolute; inset: 0; display: flex; pointer-events: none; }
.g-grid div { border-left: 1px solid #161616; }
.g-bar { position: absolute; top: 14px; height: 22px; border-radius: 4px; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 7px;
  overflow: hidden; white-space: nowrap; cursor: pointer; min-width: 6px; }
.g-bar:hover { outline: 2px solid #fff; }
.g-bar.planned { opacity: .45; }
.g-bar.done { opacity: .75; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .85; z-index: 2; pointer-events: none; }
.g-deadline { position: absolute; top: 18px; width: 13px; height: 13px; transform: translateX(-50%) rotate(45deg); background: #fff; border: 2px solid #000; z-index: 3; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.load { display: grid; overflow-x: auto; }
.load-row { display: grid; border-bottom: 1px solid var(--border); }
.load-row:last-child { border-bottom: 0; }
.load-row > div { padding: 8px 10px; border-left: 1px solid var(--border); min-width: 0; }
.load-row > div:first-child { border-left: 0; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.load-head > div { font-size: 13px; color: var(--muted); font-weight: 700; background: #0a0a0a; }
.chip { display: block; font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid #777; border-radius: 4px; padding: 3px 8px; margin-bottom: 4px;
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.late { border-left-color: var(--danger); background: var(--danger-bg); }
.chip:hover { border-color: #666; }

/* ---------- czas pracy ---------- */
.weeknav { display: flex; align-items: center; gap: 8px; }
.weeknav b { min-width: 200px; text-align: center; }
.quick { display: grid; grid-template-columns: 150px minmax(180px, 2fr) 170px 95px minmax(160px, 3fr) auto; gap: 8px; align-items: end; }
.quick label { font-size: 13px; color: var(--muted); font-weight: 700; display: flex; flex-direction: column; gap: 5px; }
.ts td.day, .ts th.day { text-align: center; width: 74px; }
.ts td.today, .ts th.today { background: var(--surface-2); }
.ts td.zero { color: #444; }

/* ---------- biura branżowe i pliki ---------- */
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-head.pad { padding: 16px 20px 0; }
.badge.b-internal { background: var(--warn-bg); color: var(--warn); font-size: 11.5px; margin-left: 6px; vertical-align: 1px; }
.step.static { cursor: default; }
.step.static:hover { border-color: var(--border); color: inherit; }
.step.static.current:hover { border-color: #fff; }
.g-bar.ro { cursor: default; }
.g-bar.ro:hover { outline: none; }
.dropzone { border: 1px dashed var(--border-strong); margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px; transition: background .15s, border-color .15s; }
.dropzone.over { background: var(--surface-2); border-color: #fff; }
.drop-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; }
.drop-opts { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: 8px; }
.upl { display: grid; grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; }
.upl > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upl .bar { height: 6px; background: var(--surface-3); border-radius: 9px; overflow: hidden; }
.upl .bar span { display: block; height: 100%; width: 0; background: #fff; transition: width .2s; }
.upl.done .bar span { background: var(--ok); width: 100% !important; }
.upl.err .bar span { background: var(--danger); width: 100% !important; }
.upl.err small { color: var(--danger); }
#uploads:empty { display: none; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .75); display: grid; place-items: start center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; width: 100%; max-width: 660px; box-shadow: 0 20px 60px rgba(0, 0, 0, .8); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; padding: 18px 22px; }
.form .form-error { padding: 0 22px 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.modal-foot { display: flex; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: #0a0a0a; border-radius: 0 0 10px 10px; }
.spacer { flex: 1; }

#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #fff; color: #000; font-weight: 700; padding: 10px 16px; border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, .6); animation: tin .2s ease-out; }
.toast.err { background: var(--danger); color: #000; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* ---------- responsywność ---------- */
@media (max-width: 1100px) {
  .stats, .stats.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drop-opts { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .quick { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  #nav { flex-direction: row; flex-wrap: wrap; }
  #nav .nav-sep { display: none; }
  #nav a.active::before { display: none; }
  main { padding: 18px 16px 40px; }
  .stepper { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 110px 1fr 34px; }
}
@media print {
  :root { color-scheme: light; }
  html, body, .card, .stat, th, td { background: #fff !important; color: #000 !important; }
  .sidebar, .actions, .filters, .tabs, #toasts { display: none !important; }
  #app { display: block; }
  main { padding: 0; }
}
