:root{
	--bg: #eef1f4;
	--panel: #ffffff;
	--panel2: #f7f8fa;
	--header: #f3f5f7;
	--border: #dde2ea;

	--text: #111827;
	--muted: #6b7280;
	--muted2: #8b94a6;

	/* z dumpa: trax_config ui.accent */
	--accent: #00BD00;
	--accentSoft: rgba(0,189,0,0.12);

	--warn: #b45309;
	--warnSoft: rgba(180,83,9,0.10);

	--r: clamp(10px, 2.8vw, 14px);
	--r2: clamp(12px, 3.2vw, 16px);

	--tap: clamp(42px, 11vw, 48px);
	--max: min(1100px, 96vw);

	--pagePad: clamp(6px, 2vw, 16px);
	--cardPad: clamp(10px, 2.8vw, 14px);
	--gap: clamp(8px, 2.4vw, 12px);

	--shadow: 0 8px 22px rgba(17,24,39,0.08);
	--shadowSm: 0 2px 10px rgba(17,24,39,0.08);
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
	margin:0;
	color:var(--text);
	background: var(--bg);
	font: 15px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

a{ color:inherit; text-decoration:none; }
button, input, select{ font: inherit; color: inherit; }

html.erp-noscroll, html.erp-noscroll body{
	overflow: hidden !important;
	height: 100% !important;
}

/* ===== TOP BAR ===== */
.erp-app{ min-height: 92vh; }

.erp-top{
	position: sticky;
	top: 0;
	z-index: 50;
	padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
	background: var(--header);
	border-bottom: 1px solid var(--border);
	box-shadow: var(--shadowSm);
	display:flex;
	gap: 10px;
	align-items:center;
}

.erp-brand{ display:flex; align-items:center; gap: 10px; min-width:0; flex:1; }
.erp-logo{
	height: 75px;
	display:flex; 
	align-items:center; 
	justify-content:center;
}
.erp-logoimg{
	height: 5vh;
	display: block;
	object-fit: contain;
}
.erp-brandtext{ min-width:0; }
.erp-title{
	font-size: 14px;
	font-weight: 750;
	white-space: nowrap;
	overflow:hidden;
	text-overflow: ellipsis;
}
.erp-subtitle{
	font-size: 12px;
	color: var(--muted);
	white-space: nowrap;
	overflow:hidden;
	text-overflow: ellipsis;
}

/* ===== HEADER: zegar (środek) + licznik (prawy róg) — tylko desktop ===== */
.erp-topclock-center{
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	font-size: 22px;
	font-weight: 900;
	letter-spacing: .4px;
	padding: 6px 14px;
	border-radius: var(--r);
	border: 1px solid var(--border);
	background: var(--panel);
	box-shadow: var(--shadowSm);
	white-space: nowrap;
	pointer-events: none;
}

.erp-topcounter{
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: var(--tap);
	padding: 0 12px;
	border-radius: var(--r);
	border: 1px solid var(--border);
	background: var(--panel);
	box-shadow: var(--shadowSm);
	font-size: 14px;
	font-weight: 850;
	white-space: nowrap;
}

.erp-topcounter strong{
	font-size: 20px;
	font-weight: 950;
}

@media (max-width: 979px){
	.erp-topclock-center,
	.erp-topcounter{
		display: none !important;
	}
}

.erp-btn{
	height: var(--tap);
	padding: 0 14px;
	border-radius: var(--r);
	border: 1px solid var(--border);
	background: var(--panel);
	cursor:pointer;
	
}
.erp-btn:hover{ background: var(--panel2); }
.erp-btn:active{ transform: translateY(1px); }
.erp-btn:disabled{
	opacity: 0.55;
	cursor: not-allowed;
	background: var(--panel2);
	transform: none;
}

.erp-btn-ghost{
	background: transparent;
}

.erp-menubtn{
	min-width: 110px;
	text-align: center;
}

/* ===== SHELL ===== */
.erp-shell{
	position: relative;
	display:flex;
}

.erp-dim{
	display:none;
	position: fixed;
	inset: 0;
	background: rgba(17,24,39,0.35);
	z-index: 53;
}

/* ===== MODAL (PAYMENT EDIT) ===== */
.erp-modal-dim{
	position: fixed;
	inset: 0;
	background: rgba(17,24,39,0.40);
	z-index: 60;
	display:none; /* ważne: domyślnie ukryty */
	align-items:center;
	justify-content:center;
	padding: 14px;
}
.erp-modal-dim:not([hidden]){
	display:flex;
}
.erp-modal-dim[hidden]{
	display:none !important;
}

.erp-modal{
	width: min(520px, 94vw);
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--r2);
	box-shadow: var(--shadow);
	overflow:hidden;
}

.erp-modalhead{
	padding: 12px 14px;
	background: var(--panel2);
	border-bottom: 1px solid var(--border);
	font-weight: 700;
}

.erp-modalbody{
	padding: 14px;
	display:grid;
	gap: 12px;
}

.erp-modalactions{
	padding: 12px 14px;
	border-top: 1px solid var(--border);
	display:flex;
	gap: 10px;
	justify-content:flex-end;
}

/* ===== LIGHTBOX (ZDJĘCIA) ===== */
.erp-imgmodal{
	width: min(96vw, 980px);
}
.erp-imgbody{
	padding: 0;
	background: #000;
}
.erp-imgbody img{
	display:block;
	width: 100%;
	height: auto;
	max-height: 80vh;
	object-fit: contain;
}

.erp-asktext{
	white-space: pre-line;
	line-height: 1.35;
	color: #111827;
}

@media (max-width: 520px){
	.erp-modal{ width: 94vw; }
}

/* ===== SIDEBAR (OFFCANVAS) ===== */
.erp-side{
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: min(86vw, 360px);
	transform: translateX(-105%);
	transition: transform .45s cubic-bezier(.22,.61,.36,1);
	will-change: transform;
	z-index: 55;

	padding: calc(env(safe-area-inset-top) + 12px) 12px 12px;
	background: var(--panel);
	border-right: 1px solid var(--border);
	box-shadow: var(--shadow);
	display: flex;
	flex-direction: column;
	overflow: visible;
}

.erp-side.is-open{ transform: translateX(0); }
.erp-dim.is-on{ display:block; }

.erp-sidehead{
	margin-bottom: 12px;
	position: relative;
}

/* UCHO (między panelem a dim): dim(53) < ucho(54) < panel(55) */
.erp-sidetab{
	position: fixed;
	top: calc(env(safe-area-inset-top) + 56px);
	left: calc(min(86vw, 360px) - 10px); /* 10px "wchodzi" pod panel */
	width: 46px;
	height: 40px;

	display:flex;
	align-items:center;
	justify-content:center;

	border: 1px solid var(--border);
	border-left: none;
	border-radius: 0 var(--r2) var(--r2) 0;
	background: var(--panel);
	box-shadow: var(--shadowSm);
	cursor: pointer;

	font-size: 22px;
	line-height: 1;

	/* domyślnie niewidoczne (menu schowane) */
	opacity: 0;
	pointer-events: none;
	transform: translateX(-14px);
	transition: opacity .18s ease, transform .18s ease, background .12s ease;

	z-index: 54; /* klucz: pomiędzy dim i panelem */
}

/* pokazuj ucho TYLKO gdy menu jest otwarte */
.erp-side.is-open + .erp-sidetab{
	opacity: 1;
	pointer-events: auto;
	transform: translateX(0);
}

.erp-sidetab:hover{ background: var(--panel2); }
.erp-sidetab:active{ transform: translateX(1px); }

.erp-user{
	display:flex;
	gap: 10px;
	align-items:center;
	padding: 12px;
	padding-right: 12px; /* miejsce na "ucho" */
	border: 1px solid var(--border);
	border-radius: var(--r2);
	background: var(--panel2);
	position: relative;
}

.erp-avatar{
	width: 38px; height: 38px;
	border-radius: var(--r);
	display:flex; align-items:center; justify-content:center;
	background: var(--panel);
	border: 1px solid var(--border);
	font-weight: 800;
}
.erp-username{ font-weight: 750; }
.erp-userhint{ color: var(--muted); font-size: 12px; }

.erp-userclose{
	position: absolute;
	top: 50%;
	right: -46px; /* "ucho" wystaje */
	transform: translateY(-50%);
	width: 46px;
	height: 40px;
	display:flex;
	align-items:center;
	justify-content:center;

	border: 1px solid var(--border);
	border-left: none;
	border-radius: 0 var(--r2) var(--r2) 0;
	background: var(--panel2);
	box-shadow: var(--shadow);
	cursor: pointer;

	font-size: 22px;
	line-height: 1;
	z-index: 55;
}

.erp-userclose:hover{ background: var(--panel); }
.erp-userclose:active{ transform: translateY(-50%) translateY(1px); }

.erp-nav{
	display:flex;
	flex-direction:column;
	gap: 14px;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding-right: 2px;
}
.erp-navgroup{ display:flex; flex-direction:column; gap: 8px; }
.erp-navtitle{ color: var(--muted2); font-size: 11px; letter-spacing: .8px; }

.erp-navitem{
	display:flex;
	align-items:center;
	justify-content:space-between;
	gap: 10px;
	padding: 12px;
	border-radius: var(--r2);
	border: 1px solid var(--border);
	background: var(--panel);
	min-height: var(--tap);
}
.erp-navitem:hover{ background: var(--panel2); }
.erp-navitem.is-active{
	border-color: rgba(0,189,0,0.45);
	background: var(--accentSoft);
}
.erp-navitem.is-disabled{
	opacity: .55;
	pointer-events: none;
}

.erp-navitem.is-danger{
	border-color: rgba(220,38,38,0.35);
	background: rgba(220,38,38,0.06);
	color: #b91c1c;
}
.erp-navitem.is-danger:hover{ background: rgba(220,38,38,0.10); }

.erp-bitem.is-danger{
	border-color: rgba(220,38,38,0.35);
	background: rgba(220,38,38,0.06);
	color: #b91c1c;
}

.erp-pill{
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 12px;
	border: 1px solid var(--border);
	background: var(--panel2);
}
.erp-pill-ok{ border-color: rgba(0,189,0,0.35); background: var(--accentSoft); }
.erp-pill-yellow{ border-color: rgba(202,138,4,0.45); background: rgba(202,138,4,0.10); color: #a16207; } /* w bazie rajdu */
.erp-pill-blue{ border-color: rgba(37,99,235,0.45); background: rgba(37,99,235,0.10); color: #1d4ed8; }   /* na trasie */
.erp-pill-warn{ border-color: rgba(180,83,9,0.35); background: var(--warnSoft); }
.erp-pill-danger{ border-color: rgba(220,38,38,0.35); background: rgba(220,38,38,0.08); color: #b91c1c; }
.erp-tag{ font-size: 12px; color: var(--muted); }

.erp-dot{
	display:inline-block;
	width: 10px;
	height: 10px;
	border-radius: 999px;
	margin-right: 8px;
	border: 1px solid rgba(17,24,39,0.18);
	vertical-align: middle;
}
.erp-dot-ok{ background: rgba(0,189,0,0.85); }
.erp-dot-warn{ background: rgba(220,38,38,0.85); }

.erp-role-select{
	font-size: 12px;
	border: 1px solid var(--border);
	background: var(--panel2);
	color: #111827;
	padding: 6px 10px;
	border-radius: 10px;
	max-width: 220px;
}
.erp-role-select:focus{
	outline: none;
	border-color: rgba(0,189,0,0.45);
	box-shadow: 0 0 0 3px rgba(0,189,0,0.10);
}

/* ===== ROLE: wspólne kolory ról systemowych ===== */
.erp-role-badge{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	max-width:100%;
	border-radius:999px;
	padding:4px 9px;
	border:1px solid rgba(15,23,42,0.10);
	background:#ffffff;
	font-size:10px;
	line-height:1.1;
	font-weight:950;
	white-space:nowrap;
}

.erp-role-badge--root{
	border-color:rgba(185,28,28,0.40);
	background:rgba(185,28,28,0.10);
	color:#991b1b;
}

.erp-role-badge--organizator{
	border-color:rgba(37,99,235,0.42);
	background:rgba(37,99,235,0.10);
	color:#1d4ed8;
}

.erp-role-badge--sedzia-glowny{
	border-color:rgba(124,58,237,0.38);
	background:rgba(124,58,237,0.10);
	color:#6d28d9;
}

.erp-role-badge--sedzia-odcinkowy{
	border-color:rgba(217,119,6,0.40);
	background:rgba(217,119,6,0.11);
	color:#b45309;
}

.erp-role-badge--biuro{
	border-color:rgba(22,163,74,0.38);
	background:rgba(22,163,74,0.10);
	color:#15803d;
}

.erp-role-badge--other{
	border-color:rgba(100,116,139,0.28);
	background:rgba(100,116,139,0.09);
	color:#475569;
}

.erp-role-actor{
	font-weight:950;
}

.erp-role-actor--root{ color:#991b1b; }
.erp-role-actor--organizator{ color:#1d4ed8; }
.erp-role-actor--sedzia-glowny{ color:#6d28d9; }
.erp-role-actor--sedzia-odcinkowy{ color:#b45309; }
.erp-role-actor--biuro{ color:#15803d; }
.erp-role-actor--other{ color:var(--text); }

/* ===== MAIN ===== */
.erp-main{
	width: 100%;
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding: var(--pagePad) var(--pagePad) calc(90px + env(safe-area-inset-bottom));
}

.erp-pagehead{
	width: 100%;
	max-width: var(--max);
	margin: 0 auto var(--gap);
	display:flex;
	justify-content:space-between;
	gap: var(--gap);
	align-items:center;
}

.erp-h1{ margin:0; font-size: 18px; font-weight: 820; }
.erp-desc{ color: var(--muted); margin-top: 6px; }

.erp-view{
	width: 100%;
	max-width: var(--max);
	margin: 0 auto;
	display:flex;
	flex-direction:column;
	gap: var(--gap);
}

.erp-view[hidden]{
	display: none !important;
}


/* ===== BIG TILES (DASHBOARD) ===== */
.erp-tiles{
	display:grid;
	grid-template-columns: 1fr;
	gap: 12px;
}
.erp-tile{
	border: 1px solid var(--border);
	border-radius: var(--r2);
	background: var(--panel);
	box-shadow: var(--shadowSm);
	padding: 18px;
	min-height: 92px;

	display:flex;
	flex-direction:column;
	justify-content:center;
	gap: 6px;
}
.erp-tile:hover{ background: var(--panel2); }
.erp-tile-title{ font-size: 18px; font-weight: 850; }
.erp-tile-meta{ color: var(--muted); }

@media (max-width: 979px){
	/* dashboard: 2 kolumny na mobile + 95% szerokości */
	.erp-tiles{ grid-template-columns: repeat(2, 1fr); width: 95vw; margin: 0 auto; }

	/* Obsługa tagów: 4 kafle pod sobą + wypełnienie dostępnej przestrzeni */
	.erp-view[data-view="sedziowie_tagi_nfc"]{ flex: 1; }

	.erp-view[data-view="sedziowie_tagi_nfc"] .erp-card{
		flex: 1;
		display: flex;
		flex-direction: column;
	}

	.erp-view[data-view="sedziowie_tagi_nfc"] .erp-pad{
		flex: 1;
		display: flex;
		flex-direction: column;
		min-height: 0;
	}

	.erp-view[data-view="sedziowie_tagi_nfc"] .erp-tiles.erp-tiles-nfc{
		flex: 1;
		min-height: 0;

		/* węższe, żeby nie ucinało z prawej */
		max-width: 80vw;
		margin: 0 auto;

		/* override dla globalnego mobile (który robi 2 kolumny) */
		grid-template-columns: 1fr;
		grid-template-rows: repeat(5, minmax(90px, 1fr));
		gap: 12px;
	}

	.erp-view[data-view="sedziowie_tagi_nfc"] .erp-tiles.erp-tiles-nfc .erp-tile{
		min-height: 15vh;
	}

	/* gdy nic nie wybrane — pane ma nie zajmować miejsca */
	.erp-view[data-view="sedziowie_tagi_nfc"] #erpNfcPane:empty{
		display: none;
	}
}

/* ===== NFC: kafle narzędzi (Obsługa tagów) ===== */
button.erp-tile{
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	text-align: left;
	cursor: pointer;
	color: inherit;
	font: inherit;
}

button.erp-tile:disabled{
	opacity: .55;
	cursor: not-allowed;
}
button.erp-tile:disabled:hover{
	background: var(--panel);
}

.erp-tiles-nfc{
	width: min(1200px, 98vw);
	margin: 0 auto;
}

.erp-tiles-nfc .erp-tile.is-active{
	border-color: rgba(0,189,0,0.45);
	background: var(--accentSoft);
}

.erp-nfc-pane{
	margin-top: 12px;
}

/* ===== NFC: wizualizacja tagów (mapa) ===== */
.erp-mapwrap{
	border: 1px solid var(--border);
	border-radius: var(--r2);
	overflow: hidden;
	background: var(--panel2);
}

.erp-map{
	width: 100%;
	height: min(70vh, 700px);
}

@media (max-width: 979px){
	.erp-map{ height: 65vh; }
}

.erp-map-osline{
	filter: drop-shadow(0 1px 2px rgba(0,0,0,0.18));
}

.erp-map-stageline{
	filter: drop-shadow(0 1px 2px rgba(0,0,0,0.14));
}

/* ===== Leaflet: legenda + ikonki tagów ===== */
.erp-map-legend{
	background: rgba(18, 18, 18, 0.92);
	color: #fff;
	border: 1px solid rgba(255,255,255,0.12);
	border-radius: var(--r2);
	padding: 10px 12px;
	box-shadow: 0 10px 24px rgba(0,0,0,0.35);
	min-width: 180px;
}

.erp-map-legend .ttl{
	font-weight: 850;
	margin-bottom: 8px;
}

.erp-map-legend .row{
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 6px 0;
	font-size: 13px;
}

.erp-map-legend .dot{
	width: 12px;
	height: 12px;
	border-radius: 999px;
	display: inline-block;
	border: 2px solid rgba(255,255,255,0.9);
	box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.erp-map-legend .dot.stage{ background: #1e90ff; }
.erp-map-legend .dot.os{ background: #f59e0b; }
.erp-map-legend .dot.cp{ background: #22c55e; }
.erp-map-legend .dot.other{ background: #a3a3a3; }

.erp-map-basectl{
	display:flex;
	align-items:center;
	gap:4px;
	padding:4px;
	border-radius:999px;
	background:rgba(17,24,39,0.90);
	border:1px solid rgba(255,255,255,0.18);
	box-shadow:0 10px 24px rgba(0,0,0,0.28);
}

.erp-map-basectl button{
	border:0;
	border-radius:999px;
	padding:6px 10px;
	background:transparent;
	color:#e5e7eb;
	font-size:11px;
	font-weight:900;
	letter-spacing:.04em;
	line-height:1;
	cursor:pointer;
}

.erp-map-basectl button.is-active{
	background:#fff;
	color:#111827;
	box-shadow:0 4px 12px rgba(0,0,0,0.22);
}

.erp-map-basectl button:focus-visible{
	outline:2px solid #22c55e;
	outline-offset:2px;
}

.erp-map-lockctl button{
	min-height:38px;
	border-radius:999px;
	border:1px solid rgba(0,0,0,0.18);
	background:rgba(255,255,255,0.94);
	color:#111827;
	padding:0 12px;
	font-weight:900;
	font-size:12px;
	box-shadow:0 8px 22px rgba(0,0,0,0.18);
	cursor:pointer;
}

.erp-map-lockctl button.is-active{
	border-color:rgba(0,189,0,0.45);
	background:rgba(221,255,221,0.96);
}

.erp-map-lockctl button:focus-visible{
	outline:2px solid #22c55e;
	outline-offset:2px;
}

.erp-map-legend{
	max-width:min(280px, calc(100vw - 34px));
}

.erp-map-legend .erp-live-legend-swatch{
	width:28px;
	min-width:28px;
	height:22px;
}

.erp-map-legend .erp-live-legend-swatch-crew{
	width:38px;
	min-width:38px;
}

.erp-map-legend .erp-live-legend-swatch-user{
	width:26px;
	min-width:26px;
	height:26px;
}

.erp-map-legend .erp-geoscanmarker{
	width:16px;
	height:16px;
	min-width:16px;
	border-width:2px;
	box-shadow:0 4px 10px rgba(0,0,0,0.25);
}

.erp-map-legend .erp-geoscanmarker::before{
	inset:-5px;
}

.erp-map-legend .erp-geoscanmarker span{
	width:6px;
	height:6px;
}

.erp-map-legend .erp-geoeditmarker{
	width:18px;
	height:18px;
	min-width:18px;
	border-width:2px;
	box-shadow:0 0 0 3px rgba(220,38,38,0.28), 0 4px 10px rgba(0,0,0,0.26);
}

.erp-map-legend .erp-geoeditmarker::before{
	width:11px;
	height:2px;
}

.erp-map-legend .erp-geoeditmarker::after{
	width:2px;
	height:11px;
}

.erp-map-legend-line{
	display:inline-block;
	width:28px;
	min-width:28px;
	height:0;
	border-top:4px solid #0f766e;
	border-radius:999px;
	box-shadow:0 3px 8px rgba(0,0,0,0.26);
}

.erp-map-legend-line.stage{
	border-top-color:#111827;
	border-top-style:dashed;
	background:#fff;
}

.erp-map-legend-line.os{
	border-top-color:#2563eb;
}

@media (max-width: 720px){
	.erp-map-basectl button{
		padding:7px 9px;
		font-size:10px;
	}
	.erp-map-legend{
		padding:8px 10px;
		min-width:160px;
		max-width:min(250px, calc(100vw - 28px));
	}
	.erp-map-legend .row{
		font-size:12px;
		gap:7px;
		margin:5px 0;
	}
}

/* Ikonka Leaflet (DIV) */
.erp-map-icon{
	width: 18px;
	height: 18px;
	border-radius: 999px;
	border: 3px solid rgba(255,255,255,0.95);
	box-shadow: 0 6px 16px rgba(0,0,0,0.35);
	transform: translateZ(0);
}

.erp-map-icon.stage{ background: #1e90ff; }
.erp-map-icon.os{ background: #f59e0b; }
.erp-map-icon.cp{ background: #22c55e; }
.erp-map-icon.other{ background: #a3a3a3; }
.erp-map-icon.track{ background: #ef4444; }   /* pozycje kontrolne (GPS) */
.erp-map-icon.scan{ background: #3b82f6; }    /* skany NFC */

/* Live tracking: kropka + etykieta nad nią */
.erp-livemarker{
	position: relative;
	width: 60px;
	height: 34px;
}

.erp-crewdiamond{
	position: absolute;
	left: 50%;
	bottom: 1px;
	transform: translateX(-50%) rotate(45deg);
	width: 10px;
	height: 10px;
	background: #000;
	border: 2px solid #fff;
	box-shadow: 0 6px 14px rgba(0,0,0,0.35);
	border-radius: 2px;
}

/* Live tracking: tag NFC jako większa kropka (klikalna) */
.erp-tagdot{
	width: 14px;
	height: 14px;
	border-radius: 999px;
	background: #3b82f6;
	border: 3px solid #fff;
	box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

.erp-livelabel{
	position: absolute;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	background: #fff;
	color: #000;
	border: 1px solid rgba(0,0,0,0.35);
	border-radius: 8px;
	padding: 2px 6px;
	font-weight: 900;
	font-size: 12px;
	line-height: 1.1;
	white-space: nowrap;
	box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

/* Live tracking: marker z numerem startowym */
.erp-livebadge{
	width: 34px;
	height: 34px;
	border-radius: 999px;
	border: 3px solid rgba(255,255,255,0.95);
	box-shadow: 0 8px 18px rgba(0,0,0,0.35);
	background: rgba(0,0,0,0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	transform: translateZ(0);
}

.erp-livebadge-inner{
	color: #fff;
	font-weight: 900;
	font-size: 13px;
	line-height: 1;
	padding: 0 6px;
	white-space: nowrap;
}

/* Live tracking: checkbox w stylu ERP */
.erp-livechk{
	display:flex;
	align-items:flex-end;
	padding-bottom: 2px;
}

.erp-live-tagpanel{
	margin: 0 0 12px;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--r2);
	background: var(--panel2);
}
.erp-live-tagpanel-head{
	display:flex;
	align-items:flex-start;
	justify-content:space-between;
	gap: 12px;
	margin-bottom: 8px;
}
.erp-live-tagpanel-head > div{
	font-weight: 900;
}
.erp-live-tagpanel-head > span{
	font-size: 12px;
	line-height: 1.35;
	color: var(--muted);
	text-align:right;
}
.erp-live-classfilters{
	display:flex;
	flex-wrap:wrap;
	gap: 8px;
}
.erp-live-classpill{
	padding: 8px 10px;
	box-shadow: none;
}

.erp-checkpill{
	display:flex;
	align-items:center;
	gap:10px;
	padding: 10px 12px;
	border-radius: 12px;
	border: 1px solid rgba(0,0,0,0.12);
	background: #fff;
	box-shadow: 0 8px 18px rgba(0,0,0,0.06);
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
}

.erp-checkpill input{
	width: 18px;
	height: 18px;
	accent-color: #3b82f6;
	cursor: pointer;
}

.erp-checkpill span{
	font-weight: 800;
	color: #111;
	font-size: 13px;
}

.erp-row.erp-live-actions{
	flex:0 0 auto;
	justify-content:flex-end;
	gap:10px;
	flex-wrap:nowrap;
}
.erp-row.erp-live-actions .erp-btn{
	min-width:118px;
}

.erp-geotools{
	display:flex;
	gap:10px;
	flex-wrap:wrap;
	margin-bottom:12px;
}

.erp-view[data-view="live_tracking"] .erp-mapwrap{
	position:relative;
}

.erp-map-lockbtn{
	display:none;
	position:absolute;
	top:10px;
	right:10px;
	z-index:500;
	min-height:38px;
	border-radius:999px;
	border:1px solid rgba(0,0,0,0.18);
	background:rgba(255,255,255,0.94);
	color:#111827;
	padding:0 12px;
	font-weight:900;
	font-size:12px;
	box-shadow:0 8px 22px rgba(0,0,0,0.18);
}

.erp-map-lockbtn.is-active{
	border-color:rgba(0,189,0,0.45);
	background:rgba(221,255,221,0.96);
}

@media (max-width: 720px){
	.erp-view[data-view="live_tracking"] .erp-card{
		width: 100%;
	}
	.erp-view[data-view="live_tracking"] .erp-cardhead{
		display:grid;
		grid-template-columns:1fr;
		align-items:stretch;
		gap:10px;
	}
	.erp-row.erp-live-actions{
		width:100%;
		display:grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}
	.erp-row.erp-live-actions .erp-btn{
		width:100%;
		min-width:0;
		padding: 0 8px;
		font-size: 12px;
	}
	.erp-live-jumpbar .erp-field{
		min-width: 100% !important;
	}
	.erp-live-tagpanel-head{
		flex-direction: column;
		gap: 3px;
	}
	.erp-live-tagpanel-head > span{
		text-align:left;
	}
	.erp-live-classfilters{
		display:grid;
		grid-template-columns: 1fr 1fr;
	}
	.erp-live-classpill{
		justify-content:flex-start;
		white-space: normal;
	}
	.erp-geotools{
		display:grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 8px;
	}
	.erp-view[data-view="live_tracking"] .erp-geotools .erp-btn{
		width:100%;
		min-width:0;
		padding: 0 6px;
		font-size: 11px;
	}
	.erp-view[data-view="live_tracking"] .erp-map{
		height:46vh;
		height:46dvh;
		min-height:320px;
		max-height:430px;
	}
	.erp-view[data-view="live_tracking"] .erp-map-lockbtn{
		display:inline-flex;
		align-items:center;
		justify-content:center;
	}
}

.erp-btn.is-active{
	border-color: rgba(0,189,0,0.45);
	background: var(--accentSoft);
}

.erp-live-legend{
	display:flex;
	flex-wrap:wrap;
	gap:10px 16px;
	align-items:center;
	margin:0 0 12px;
	padding:10px 12px;
	border:1px solid var(--border);
	border-radius:var(--r2);
	background:var(--panel2);
}

.erp-live-legend-item{
	display:flex;
	align-items:center;
	gap:8px;
	font-weight:800;
	font-size:13px;
	line-height:1.2;
}

.erp-live-legend-swatch{
	width:38px;
	min-width:38px;
	height:24px;
	display:inline-flex;
	align-items:center;
	justify-content:center;
}

.erp-live-legend-swatch svg{
	display:block;
	max-width:100%;
	max-height:100%;
}

.erp-live-legend-swatch-crew svg{
	filter:drop-shadow(0 4px 10px rgba(0,0,0,0.18));
}

.erp-live-legend-flag,
.erp-geotagflag{
	--tag-color:#111827;
	display:inline-block;
	width:14px;
	height:14px;
	border:2px solid #fff;
	border-radius:3px;
	box-shadow:0 6px 14px rgba(0,0,0,0.25);
	transform:rotate(-8deg);
	background-color:#fff;
	background-repeat:repeat;
	background-size:8px 8px;
	background-image:conic-gradient(from 90deg, #ffffff 0 25%, var(--tag-color) 0 50%, #ffffff 0 75%, var(--tag-color) 0 100%);
}

.erp-live-legend-flag.stage,
.erp-geotagflag.stage{
	--tag-color:#111827;
}

.erp-live-legend-flag.os,
.erp-geotagflag.os{
	--tag-color:#2563eb;
}

.erp-live-legend-flag.oscp,
.erp-geotagflag.oscp{
	--tag-color:#2563eb;
	border-radius:4px;
	transform:rotate(45deg);
}

.erp-live-legend-dot{
	width:10px;
	height:10px;
	border-radius:999px;
	background:#f59e0b;
	border:2px solid #fff;
	box-shadow:0 4px 10px rgba(0,0,0,0.22);
}

.erp-live-legend-swatch-user{
	width:28px;
	min-width:28px;
	height:28px;
	border-radius:999px;
	background:#fff;
	border:2px solid #2563eb;
	box-shadow:0 6px 12px rgba(0,0,0,0.16);
}

.erp-geocrewmarker{
	position:relative;
	width:104px;
	height:70px;
}

.erp-geocrewcar{
	position:absolute;
	left:50%;
	bottom:2px;
	transform:translateX(-50%);
	width:52px;
	height:34px;
	filter:drop-shadow(0 8px 16px rgba(0,0,0,0.28));
}

.erp-geocrewcar svg{
	display:block;
	width:100%;
	height:100%;
}

.erp-geocrewtxt{
	position:absolute;
	left:50%;
	bottom:34px;
	transform:translateX(-50%);
	background:#fff;
	color:#000;
	border:1px solid rgba(0,0,0,0.35);
	border-radius:999px;
	padding:1px 7px;
	font-weight:900;
	font-size:11px;
	line-height:1.2;
	min-width:24px;
	text-align:center;
	pointer-events:none;
	box-shadow:0 6px 14px rgba(0,0,0,0.18);
	white-space:nowrap;
}

.erp-geocrewlabel{
	position:absolute;
	left:50%;
	bottom:54px;
	transform:translateX(-50%);
	background:#fff;
	color:#000;
	border:1px solid rgba(0,0,0,0.35);
	border-radius:8px;
	padding:2px 6px;
	font-weight:900;
	font-size:11px;
	line-height:1.1;
	white-space:nowrap;
	box-shadow:0 6px 14px rgba(0,0,0,0.18);
	max-width:180px;
	overflow:hidden;
	text-overflow:ellipsis;
}

.erp-geotagdot{
	display:inline-block;
	width:10px;
	height:10px;
	border-radius:999px;
	border:2px solid #fff;
	box-shadow:0 8px 18px rgba(0,0,0,0.25);
}

.erp-geoscanmarker{
	position:relative;
	width:22px;
	height:22px;
	border-radius:999px;
	background:#fff;
	border:3px solid #2563eb;
	box-shadow:0 8px 18px rgba(0,0,0,0.28);
}

.erp-geoscanmarker::before{
	content:"";
	position:absolute;
	inset:-7px;
	border-radius:999px;
	border:2px solid rgba(37,99,235,0.34);
}

.erp-geoscanmarker span{
	position:absolute;
	left:50%;
	top:50%;
	transform:translate(-50%, -50%);
	width:8px;
	height:8px;
	border-radius:999px;
	background:#2563eb;
}

.erp-geoeditmarker{
	position:relative;
	width:24px;
	height:24px;
	border-radius:999px;
	background:#111827;
	border:3px solid #fff;
	box-shadow:0 0 0 4px rgba(220,38,38,0.28), 0 10px 20px rgba(0,0,0,0.32);
}

.erp-geoeditmarker::before,
.erp-geoeditmarker::after{
	content:"";
	position:absolute;
	left:50%;
	top:50%;
	transform:translate(-50%, -50%);
	background:#ef4444;
}

.erp-geoeditmarker::before{
	width:14px;
	height:3px;
	border-radius:999px;
}

.erp-geoeditmarker::after{
	width:3px;
	height:14px;
	border-radius:999px;
}

.erp-geousermarker{
	position:relative;
	width:30px;
	height:38px;
}

.erp-geouserbubble{
	position:absolute;
	left:50%;
	top:0;
	transform:translateX(-50%);
	width:28px;
	height:28px;
	border-radius:999px;
	background:#fff;
	border:2px solid #2563eb;
	box-shadow:0 8px 16px rgba(0,0,0,0.24);
	display:flex;
	align-items:center;
	justify-content:center;
}

.erp-geouserbubble svg{
	display:block;
	width:14px;
	height:18px;
}

.erp-geousermarker::after{
	content:"";
	position:absolute;
	left:50%;
	bottom:0;
	transform:translateX(-50%);
	width:0;
	height:0;
	border-left:6px solid transparent;
	border-right:6px solid transparent;
	border-top:10px solid #2563eb;
}

@media (max-width: 720px){
	.erp-live-legend{
		gap:8px 12px;
		padding:8px 10px;
	}
	.erp-live-legend-item{
		font-size:12px;
	}
}

.erp-nfc-out{
	border: 1px solid var(--border);
	border-radius: var(--r2);
	background: var(--panel2);
	padding: 10px 12px;
	white-space: pre-wrap;
	word-break: break-word;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 12px;
	line-height: 1.35;
	max-height: 34vh;
	overflow: auto;
}

@media (min-width: 980px){
	/* “w środku” na desktopie */
	.erp-view[data-view="sedziowie_tagi_nfc"]{
		min-height: calc(100dvh - 240px);
		justify-content: center;
	}
}

/* ===== CARDS ===== */
.erp-card{
	border: 1px solid var(--border);
	border-radius: var(--r2);
	background: var(--panel);
	box-shadow: var(--shadowSm);
	overflow:hidden;
	width: 100%;
	max-width: 100%;
	min-width: 0;
}
.erp-cardhead{
	padding: var(--cardPad);
	border-bottom: 1px solid var(--border);
	display:flex;
	justify-content:space-between;
	gap: var(--gap);
	align-items:center;
}
.erp-cardtitle{ font-weight: 850; }
.erp-pad{ padding: var(--cardPad); }

/* ===== GRID HELPERS ===== */
.erp-grid{ display:grid; }
.erp-gap{ gap: var(--gap); }

/* kreator tras: karty zagnieżdżone nie mogą mieć 90vw (bo wylatują poza kontener) */
.erp-view[data-view="kreator_tras"] .erp-card .erp-card{ width: 100%; }

/* QR emulator: karty zagnieżdżone nie mogą mieć 90vw (bo wylatują poza kontener) */
.erp-view[data-view="sedziowie_qr_emulator"] .erp-card .erp-card{ width: 100%; }

/* GPS edit: karta boczna "Wybrany tag" też nie może dziedziczyć globalnego 90vw */
.erp-view[data-view="sedziowie_nfc_gps_edit"] .erp-card .erp-card{ width: 100%; }

@media (max-width: 979px){
	/* kreator tras: na telefonie jedna kolumna */
	.erp-view[data-view="kreator_tras"] .erp-grid{ grid-template-columns: 1fr !important; }
}

.erp-row{ display:flex; gap: var(--gap); align-items:center; flex-wrap:wrap; min-width:0; }
.erp-app-actions{ justify-content:flex-end; }
.erp-muted{ color: var(--muted); }

/* ===== FORMS ===== */
.erp-formrow{
	display:grid;
	gap: 12px;
	padding: 14px;
}

/* ===== KREATOR TRAS: formrow inline (bo globalnie .erp-formrow jest GRID) ===== */
.erp-view[data-view="kreator_tras"] .erp-formrow.erp-formrow-inline{
	display:flex;
	flex-wrap:wrap;
	align-items:flex-end;
	gap: 12px;
}

/* wyrównanie wysokości input/select i przycisków w kreatorze */
.erp-view[data-view="kreator_tras"] .erp-field input,
.erp-view[data-view="kreator_tras"] .erp-field select{
	height: 48px;
}

.erp-view[data-view="kreator_tras"] .erp-btn{
	height: 48px;
	display:inline-flex;
	align-items:center;
	justify-content:center;
}

.erp-formrow.erp-formrow-2{
	grid-template-columns: 1fr 180px;
	align-items:end;
}
@media (min-width: 720px){
	.erp-formrow.erp-formrow-2{
		grid-template-columns: 1fr 260px;
		padding: 10px;
	}
}

.erp-field{ display:flex; flex-direction:column; gap: 6px; }
.erp-field span{ color: var(--muted2); font-size: 12px; }

.erp-field input,
.erp-field select{
	height: 48px;
	border-radius: var(--r);
	border: 1px solid var(--border);
	background: #ffffff;
	color: #111827;
	padding: 0 12px;
	outline: none;
	box-shadow: 0 1px 0 rgba(17,24,39,0.03);
}

.erp-field input:focus,
.erp-field select:focus{
	border-color: rgba(0,189,0,0.45);
	box-shadow: 0 0 0 3px rgba(0,189,0,0.10);
}

.erp-field textarea{
	min-height: 96px;
	border-radius: var(--r);
	border: 1px solid var(--border);
	background: #ffffff;
	color: #111827;
	padding: 10px 12px;
	outline: none;
	box-shadow: 0 1px 0 rgba(17,24,39,0.03);
	resize: vertical;
}

.erp-field textarea:focus{
	border-color: rgba(0,189,0,0.45);
	box-shadow: 0 0 0 3px rgba(0,189,0,0.10);
}

/* ===== FILE PICKER (ładny input file) ===== */
.erp-filepick{
	height: 48px;
	display:flex;
	align-items:center;
	gap: 12px;
	border-radius: var(--r);
	border: 1px solid var(--border);
	background: #ffffff;
	padding: 0 12px;
	box-shadow: 0 1px 0 rgba(17,24,39,0.03);
}

.erp-filepick-btn{
	height: 36px;
	display:inline-flex;
	align-items:center;
}

.erp-filepick-name{
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.erp-filepick-input{
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* dropdown lista: ciemny font */
.erp-field select,
.erp-field option{
	color: #111827 !important;
	background: #ffffff !important;
}

/* ===== CONFIG VIEW ===== */
.erp-view[data-view="settings"] #erpCfgGroups{
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* grupowanie w POZIOMIE (wiersz): nagłówek po lewej, zawartość po prawej */
.erp-cfggroup{
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	padding: 0;
	border: 1px solid var(--border);
	border-radius: var(--r2);
	background: var(--panel);
	box-shadow: var(--shadowSm);
	overflow: hidden;
}

.erp-cfggrouphead{
	font-weight: 850;
	margin: 0;
	padding: 12px 14px;
	background: var(--panel2);
	border-right: 1px solid var(--border);
}

/* JS wstawia inline padding:0; nadpisujemy go */
.erp-cfggroup .erp-list{
	padding: 14px !important;
}

/* settings: element w poziomie (opis po lewej, pola po prawej) */
.erp-view[data-view="settings"] .erp-cfgitem{
	display: grid;
	grid-template-columns: 340px minmax(0, 1fr);
	gap: 16px;
	align-items: start;
}
.erp-view[data-view="settings"] .erp-cfgmeta{
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: flex-start;
	justify-content: flex-start;
	flex-wrap: nowrap;
}
.erp-view[data-view="settings"] .erp-cfgfields{
	margin-top: 0; /* było pod spodem – teraz jest w prawej kolumnie */
}

@media (max-width: 979px){
	.erp-view[data-view="settings"] .erp-cfgitem{
		display: flex;
		flex-direction: column;
		gap: 10px;
	}
	.erp-view[data-view="settings"] .erp-cfgfields{
		margin-top: 10px;
	}
	.erp-cfggroup{ grid-template-columns: 1fr; }
	.erp-cfggrouphead{
		border-right: 0;
		border-bottom: 1px solid var(--border);
	}
}


.erp-cfgfields{ display:grid; gap: 12px; margin-top: 10px; }
@media (min-width: 720px){
	.erp-cfgfields{ grid-template-columns: 1fr 1fr; }
}
.erp-cfg-span2{ grid-column: 1 / -1; }

/* ===== LISTS ===== */
.erp-list{ display:flex; flex-direction:column; gap: 10px; padding: 14px; }
.erp-item{
	display:flex;
	gap: 12px;
	align-items:center;
	justify-content:space-between;
	padding: 14px;
	border-radius: var(--r2);
	border: 1px solid var(--border);
	background: var(--panel2);
	box-shadow: 0 1px 0 rgba(17,24,39,0.03);
}
.erp-itemmain{ flex: 1; min-width:0; }
.erp-itemtop{
	display:flex;
	gap: 10px;
	align-items:center;
	justify-content:space-between;
}
.erp-itemtitle{ font-weight: 850; }
.erp-itemactions{ display:flex; gap: 8px; flex-wrap:wrap; justify-content:flex-end; }


/* ===== STATYSTYKI ===== */
.erp-stats-item{
	transition: box-shadow .15s ease, border-color .15s ease;
}
.erp-stats-item.is-ready{
	border-left: 6px solid rgba(0,189,0,0.85);
	background: linear-gradient(90deg, rgba(0,189,0,0.08) 0, rgba(0,189,0,0.03) 110px, var(--panel2) 240px);
}
.erp-stats-item.is-low{
	border-left: 6px solid rgba(220,38,38,0.85);
	background: linear-gradient(90deg, rgba(220,38,38,0.08) 0, rgba(220,38,38,0.03) 110px, var(--panel2) 240px);
}
.erp-stats-summary{
	display:flex;
	flex-direction:column;
	gap:10px;
	margin-top:10px;
}
.erp-stats-summarybox,
.erp-stats-chartbox{
	align-items:stretch;
}
.erp-stats-kpis{
	display:grid;
	grid-template-columns: repeat(4, minmax(0,1fr));
	gap:10px;
	margin-top:12px;
}
.erp-stats-kpi{
	border:1px solid var(--border);
	border-radius: 14px;
	padding:10px 12px;
	background: #fff;
	box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.erp-stats-kpi-label{
	font-size:12px;
	font-weight:850;
	color:var(--muted);
	margin-bottom:6px;
}
.erp-stats-kpi-value{
	font-size:24px;
	font-weight:900;
	line-height:1.1;
}
.erp-stats-tags{ gap: 14px; flex-wrap:wrap; }

.erp-stats-chart{
	display:grid;
	grid-template-columns: repeat(auto-fit, minmax(88px,1fr));
	gap:12px;
	align-items:end;
	margin-top:14px;
}
.erp-stats-col{
	display:flex;
	flex-direction:column;
	align-items:center;
	gap:8px;
	min-width:0;
}
.erp-stats-colvalue{
	font-size:13px;
	font-weight:900;
}
.erp-stats-coltrack{
	height:180px;
	width:100%;
	max-width:56px;
	border-radius:14px;
	border:1px solid var(--border);
	background: linear-gradient(180deg, rgba(17,24,39,0.02), rgba(17,24,39,0.06));
	padding:6px;
	display:flex;
	align-items:flex-end;
}
.erp-stats-colbar{
	width:100%;
	border-radius:10px;
	min-height:10%;
	box-shadow: inset 0 -1px 0 rgba(255,255,255,0.35);
}
.erp-stats-collabel{
	font-size:12px;
	color:var(--muted);
	text-align:center;
	line-height:1.2;
}

.erp-stats-colbar.is-oczekujace{ background: #9ca3af; }
.erp-stats-colbar.is-zatwierdzone{ background: #f59e0b; }
.erp-stats-colbar.is-odrzucone{ background: #ef4444; }
.erp-stats-colbar.is-oplacone{ background: #00BD00; }
.erp-stats-colbar.is-wbazie{ background: #eab308; }
.erp-stats-colbar.is-natrasie{ background: #3b82f6; }
.erp-stats-colbar.is-ukonczyl{ background: #16a34a; }
.erp-stats-colbar.is-dsq{ background: #b91c1c; }
.erp-stats-colbar.is-poczasie{ background: #ea580c; }

@media (max-width: 920px){
	.erp-stats-kpis{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px){
	.erp-stats-kpis{ grid-template-columns: 1fr; }
	.erp-stats-coltrack{ height:140px; }
}

/* ===== TABLE ===== */
.erp-table{ padding: 14px; display:flex; flex-direction:column; gap: 8px; }
.erp-thead, .erp-trow{
	display:grid;
	/*grid-template-columns: 52px 1fr 1fr 110px;*/
	grid-template-columns: var(--erp-cols, 52px 1fr 1fr 110px);
	gap: 10px;
	align-items:center;
	padding: 12px 12px;
	border-radius: var(--r2);
	border: 1px solid var(--border);
	background: var(--panel2);
}
.erp-thead{ color: var(--muted2); font-size: 12px; }

.erp-clickrow{ cursor:pointer; }
.erp-clickrow:hover{
	border-color: rgba(0,189,0,0.35);
	box-shadow: 0 0 0 3px rgba(0,189,0,0.08);
}

/* ===== TABS (ZGŁOSZENIA) ===== */
.erp-tabs{
	display:flex;
	gap: 8px;
	flex-wrap:wrap;
}
.erp-tab{
	height: 40px;
	padding: 0 14px;
	border-radius: 6px;
	border: 1px solid var(--border);
	background: var(--panel);
	cursor:pointer;
}
.erp-tab:hover{ background: var(--panel2); }
.erp-tab.is-active{
	border-color: rgba(0,189,0,0.45);
	background: var(--accentSoft);
}

/* ===== TABLE (GRID) ===== */
.erp-tablewrap{
	padding: 0 14px 14px;
	overflow:auto;
}
.erp-tablegrid{
	width: 100%;
	border-collapse: collapse;
	min-width: 0;
	table-layout: fixed;
}
.erp-tablegrid th,
.erp-tablegrid td{
	word-break: break-word;
}
.erp-tablegrid thead th{
	text-align: left;
	font-size: 12px;
	color: var(--muted2);
	background: var(--panel2);
	border-bottom: 1px solid var(--border);
	padding: 12px;
	vertical-align: middle;
}
.erp-tablegrid tbody td{
	border-bottom: 1px solid var(--border);
	padding: 12px;
	vertical-align: middle;
}
.erp-tablegrid tbody tr:hover{
	background: var(--panel2);
}
.erp-tr{ cursor:pointer; }
.erp-td-muted{
	color: var(--muted);
	text-align: center;
	padding: 18px 12px !important;
}
.erp-small{ font-size: 12px; color: var(--muted); }
.erp-mono{
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.erp-nfc-toggle{
	min-width: 220px;
	display:inline-flex;
	align-items:center;
	justify-content:center;
	font-weight: 850;
}

/* ===== NFC WERYFIKATOR ===== */
.erp-view[data-view="sedziowie_nfc_weryfikator"] .erp-card{
	width:100%;
	max-width:100%;
}

.erp-nfcv-head{
	align-items:stretch;
}

.erp-nfcv-titlebox{
	min-width:0;
	flex:1 1 auto;
}

.erp-nfcv-backrow{
	gap:10px;
	align-items:center;
	flex-wrap:wrap;
	margin-top:8px;
}

.erp-nfcv-actions{
	flex:0 0 auto;
	justify-content:flex-end;
	align-items:center;
}

.erp-nfcv-note{
	margin-bottom:12px;
}

.erp-nfcv-hero{
	margin-bottom:12px;
	padding:12px;
	border:1px solid var(--border);
	border-radius:var(--r2);
	background:var(--panel2);
	font-weight:900;
}

.erp-view[data-view="sedziowie_nfc_weryfikator"] .erp-kvvalue{
	text-align:left;
	padding:8px 0 0 !important;
	color:var(--text);
}

.erp-nfcv-lines{
	display:grid;
	gap:7px;
}

.erp-nfcv-line{
	display:grid;
	grid-template-columns:minmax(110px, 0.45fr) minmax(0, 1fr);
	gap:8px;
	align-items:start;
	padding:7px 0;
	border-bottom:1px solid rgba(0,0,0,0.06);
}

.erp-nfcv-line:last-child{
	border-bottom:0;
}

.erp-nfcv-line span{
	color:var(--muted);
	font-size:12px;
	font-weight:800;
}

.erp-nfcv-line strong{
	color:var(--text);
	font-size:13px;
	word-break:break-word;
}

.erp-nfcv-record{
	display:grid;
	gap:5px;
	padding:8px 0;
	border-bottom:1px solid rgba(0,0,0,0.06);
}

.erp-nfcv-record:last-child{
	border-bottom:0;
}

.erp-nfcv-record code{
	display:block;
	white-space:pre-wrap;
	word-break:break-word;
	font-size:12px;
	line-height:1.35;
	color:var(--text);
}

.erp-nfcv-auditbox{
	margin-top:8px;
	display:grid;
	gap:6px;
}

.erp-nfcv-auditrow{
	display:grid;
	grid-template-columns:minmax(130px, 0.9fr) minmax(110px, 0.7fr) minmax(0, 1fr);
	gap:8px;
	align-items:start;
	padding:7px 8px;
	border:1px solid var(--border);
	border-radius:12px;
	background:rgba(255,255,255,0.55);
	font-size:12px;
}

.erp-nfcv-auditrow span{
	color:var(--text);
	font-weight:900;
}

.erp-nfcv-auditrow em{
	color:var(--muted);
	font-style:normal;
	font-weight:800;
}

@media (max-width:720px){
	.erp-view[data-view="sedziowie_nfc_weryfikator"] .erp-cardhead{
		display:grid;
		grid-template-columns:1fr;
		gap:12px;
	}

	.erp-nfcv-backrow{
		display:grid;
		grid-template-columns:1fr;
		gap:8px;
	}

	.erp-nfcv-backrow .erp-btn,
	.erp-nfcv-actions .erp-btn{
		width:100%;
		min-width:0;
	}

	.erp-nfcv-actions{
		width:100%;
		display:grid;
		grid-template-columns:1fr;
	}

	.erp-nfcv-grid{
		grid-template-columns:1fr !important;
	}

	.erp-nfcv-line{
		grid-template-columns:1fr;
		gap:2px;
	}

	.erp-nfcv-auditrow{
		grid-template-columns:1fr;
		gap:3px;
	}
}

.erp-kv{ display:flex; flex-direction:column; gap: 3px; }

.erp-details{
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--border);
}
.erp-details summary{
	cursor: pointer;
	user-select: none;
	color: var(--muted2);
	font-weight: 750;
}
.erp-details[open] summary{ margin-bottom: 10px; }

/* ===== APPLICATION (PODGLĄD) ===== */
.erp-detail-section{
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--border);
}
.erp-detail-h{
	font-weight: 700;
	margin: 0 0 10px;
}
.erp-crew-devices-table{
	table-layout: auto;
	min-width: 900px;
}
.erp-crew-devices-table th,
.erp-crew-devices-table td{
	vertical-align: top;
}
.erp-crew-device-id{
	margin-top: 3px;
	font-size: 12px;
	word-break: break-all;
	color: var(--muted2);
}
.erp-crew-device-note{
	font-size: 12px;
	line-height: 1.35;
	color: var(--muted2);
}
@media (max-width: 720px){
	.erp-crew-devices-table{
		min-width: 0;
	}
	.erp-crew-devices-table tbody td[data-label]{
		display:grid;
		grid-template-columns: minmax(112px, 38%) minmax(0, 1fr);
		gap: 10px;
		align-items:start;
	}
	.erp-crew-devices-table tbody td[data-label]::before{
		content: attr(data-label);
		font-size: 11px;
		line-height: 1.25;
		letter-spacing: .02em;
		text-transform: uppercase;
		font-weight: 900;
		color: var(--muted);
	}
}
.erp-detail-grid{
	display:grid;
	grid-template-columns: 1fr;
	gap: 10px;
}
@media (min-width: 720px){
	.erp-detail-grid{ grid-template-columns: 1fr 1fr; }
}
.erp-kvitem{
	border: 1px solid var(--border);
	border-radius: var(--r2);
	background: var(--panel2);
	padding: 10px;
}
.erp-kvlabel{
	font-size: 12px;
	color: var(--muted);
	margin-bottom: 4px;
}
.erp-kvvalue{
	font-size: 14px;
	line-height: 1.3;
	white-space: pre-wrap;
	word-break: break-word;
}
.erp-photo{
	width: 100%;
	max-height: 260px;
	object-fit: cover;
	border-radius: var(--r2);
	border: 1px solid var(--border);
}

.erp-crew-photo-open{
	display:block;
	width:100%;
	padding:0;
	border:0;
	background:transparent;
	cursor:pointer;
	text-align:left;
}

.erp-crew-photo-img{
	display:block;
	max-height:420px;
	object-fit:contain;
	background:var(--panel);
}

.erp-crew-photo-hint{
	margin-top:8px;
	font-size:12px;
}

.erp-photoicon{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	width: 44px;
	height: 44px;
	border-radius: 14px;
	border: 1px solid var(--border);
	background: var(--panel);
	cursor:pointer;
	padding: 0;
}
.erp-photoicon:hover{ background: var(--panel2); }
.erp-photoicon span{ font-size: 20px; line-height: 1; }

.erp-veh-nameval{
	display:flex;
	align-items:center;
	justify-content:space-between;
	gap: 10px;
}

.erp-photoicon-sm{
	width: 38px;
	height: 38px;
	border-radius: 12px;
}
.erp-photoicon-sm span{ font-size: 18px; }

.erp-photoicon.is-off{
	opacity: .45;
	cursor: default;
	pointer-events: none;
}

.erp-crew-sep{
	height: 1px;
	background: var(--border);
	margin: 10px 0;
}

/* ===== CREW (PODGLĄD): Akcje + Pojazd (desktop: 2 kolumny) ===== */
.erp-actions-row{
	display:flex;
	gap: 10px;
	align-items:center;
	flex-wrap: wrap;
}

/* Akcje w podglądzie załogi: bez "małego" rozdzielacza nad sekcją */
.erp-detail-section.erp-crew-actions{
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.erp-actions-status{
	display:flex;
	align-items:center;
	gap: 10px;
	font-weight: 800;
}

/* Crew view: status lewo, przycisk DQ prawo */
.erp-detail-section.erp-crew-actions .erp-actions-status{
	margin-right: auto;
	text-align: left;
}

.erp-select{
	height: var(--tap);
	padding: 0 12px;
	border-radius: var(--r);
	border: 1px solid var(--border);
	background: var(--panel);
	color: inherit;
	min-width: 240px;
}

.erp-btn-danger{
	border-color: rgba(220,38,38,0.35);
	background: rgba(220,38,38,0.10);
	color: #b91c1c;
	font-weight: 900;
}
.erp-btn-danger:hover{
	background: rgba(220,38,38,0.14);
}

.erp-btn-warn{
	border-color: rgba(180,83,9,0.45);
	background: var(--warnSoft);
	color: #92400e;
	font-weight: 900;
}
.erp-btn-warn:hover{
	background: rgba(180,83,9,0.14);
}

.erp-veh-grid{
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

.erp-veh-left{
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

@media (min-width: 980px){
	.erp-actions-row{ flex-wrap: nowrap; }
	.erp-select{ min-width: 320px; }

	/* pojazd: lewa (nazwa+rej) / prawa (zdjęcie) */
	.erp-veh-grid{
		grid-template-columns: 1fr 1fr;
		align-items: start;
	}
	.erp-veh-grid .erp-photo{
		max-height: 360px;
	}
}

.erp-payrow{
	display:flex;
	align-items:center;
	justify-content:space-between;
	gap: 10px;
}
.erp-btn-small{
	height: 38px;
	padding: 0 12px;
	border-radius: 12px;
}

/* ===== DETAIL LAYOUT HELPERS ===== */
.erp-span2{ grid-column: 1 / -1; }

/* Imię+PESEL w jednej linii */
.erp-splitline{
	display:grid;
	grid-template-columns: 1fr 220px;
	gap: 12px;
	align-items:start;
}
@media (max-width: 720px){
	.erp-splitline{ grid-template-columns: 1fr; }
}

/* Telefon + koszulka pod sobą */
.erp-contactstack{
	display:flex;
	flex-direction:column;
	gap: 6px;
}

/* Edycja zgłoszenia: proste pola */
.erp-editname{
	display:grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}
@media (max-width: 720px){
	.erp-editname{ grid-template-columns: 1fr; }
}

.erp-editstack{
	display:flex;
	flex-direction:column;
	gap: 10px;
}

/* Pojazd: lewa kolumna info, prawa miniatura */
.erp-vehiclebox{
	display:grid;
	grid-template-columns: 1fr 220px;
	gap: 12px;
	align-items:start;
}
@media (max-width: 720px){
	.erp-vehiclebox{ grid-template-columns: 1fr; }
}
.erp-veh-lines{
	display:flex;
	flex-direction:column;
	gap: 6px;
}
.erp-veh-line strong{ font-weight: 750; }

.erp-thumb{
	width: 100%;
	max-height: 160px;
	object-fit: cover;
	border-radius: var(--r2);
	border: 1px solid var(--border);
	background: var(--panel);
}

.erp-thumb-btn{
	display:block;
	width:100%;
	padding:0;
	border:0;
	background:transparent;
	cursor:pointer;
	text-align:left;
}

.erp-thumb-btn:hover .erp-thumb{
	filter:brightness(1.08);
}

/* ===== APPLICATIONS: mobile tiles (bez przewijania) ===== */
@media (max-width: 720px){
	.erp-tablewrap{
		overflow: visible;
		padding: 0 14px 14px;
	}

	.erp-tablegrid{ display:block; width:100%; }
	.erp-tablegrid thead{ display:none; }

	.erp-tablegrid tbody{
		display:flex;
		flex-direction:column;
		gap: 10px;
	}

	.erp-tablegrid tbody tr{
		display:block;
		border: 1px solid var(--border);
		border-radius: var(--r2);
		background: var(--panel2);
		padding: 10px;
	}

	.erp-tablegrid tbody td{
		display:block;
		border: 0;
		padding: 8px 6px;
	}

	.erp-tablegrid tbody td + td{
		border-top: 1px dashed var(--border);
	}
}

.erp-warning-meta{
	margin-top: 8px;
	display: grid;
	grid-template-columns: repeat(2, minmax(180px, 1fr));
	gap: 6px 10px;
}
.erp-warning-meta > div{
	padding: 7px 9px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--panel2);
}
.erp-warning-meta span{
	display:block;
	font-size: 11px;
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--muted);
}
.erp-warning-meta strong{
	display:block;
	margin-top: 2px;
	font-size: 12px;
	line-height: 1.25;
	word-break: break-word;
}

.erp-warning-meta-details{
	margin-top:8px;
	border:1px solid var(--border);
	border-radius:12px;
	background:var(--panel2);
	overflow:hidden;
}
.erp-warning-meta-details > summary{
	list-style:none;
	cursor:pointer;
	padding:8px 10px;
	font-size:12px;
	font-weight:850;
	color:var(--muted2);
	display:flex;
	align-items:center;
	justify-content:space-between;
}
.erp-warning-meta-details > summary::-webkit-details-marker{
	display:none;
}
.erp-warning-meta-details > summary::after{
	content:"▾";
	transition:transform .18s ease;
}
.erp-warning-meta-details[open] > summary::after{
	transform:rotate(180deg);
}
.erp-warning-meta-details .erp-warning-meta{
	margin:0;
	padding:0 10px 10px;
}
.erp-flag-severity-icon{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	width:28px;
	height:28px;
	border-radius:999px;
	border:1px solid var(--border);
	background:var(--panel2);
	font-size:15px;
	line-height:1;
}
.erp-flag-severity-icon.is-danger{
	border-color:rgba(220,38,38,0.35);
	background:rgba(220,38,38,0.08);
}
.erp-flag-severity-icon.is-warn{
	border-color:rgba(180,83,9,0.35);
	background:var(--warnSoft);
}
.erp-flag-severity-icon.is-info{
	border-color:rgba(37,99,235,0.28);
	background:rgba(37,99,235,0.08);
}
.erp-flag-severity-icon.is-ok{
	border-color:rgba(0,189,0,0.35);
	background:var(--accentSoft);
}
.erp-crewtrack-scanlog-count.is-bad{
	border-color:rgba(220,38,38,0.35);
	background:rgba(220,38,38,0.08);
	color:#b91c1c;
}
@media (max-width: 720px){
	.erp-warning-meta{
		grid-template-columns: 1fr;
	}
}

/* ===== CREW RESULTS: czytelny podgląd mobilny ===== */
.erp-crew-result-subhead{
	margin: 14px 14px 8px;
	padding: 12px 14px;
	border: 1px solid var(--border);
	border-left: 4px solid var(--accent);
	border-radius: var(--r2);
	background: var(--panel2);
}
.erp-crew-result-subhead-title{
	font-weight: 900;
	font-size: 14px;
	line-height: 1.25;
}
.erp-crew-result-subhead-desc{
	margin-top: 3px;
	font-size: 12px;
	line-height: 1.35;
	color: var(--muted);
}
.erp-crew-transit-list{
	margin: 0 14px 10px;
}
.erp-crew-transit-stage{
	margin: 0 0 10px;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--r2);
	background: var(--panel2);
}
.erp-crew-transit-head{
	display:flex;
	align-items:center;
	justify-content:space-between;
	gap: 10px;
	margin: 0 0 8px;
	font-size: 12px;
	color: var(--muted);
}
.erp-crew-transit-head strong{
	font-size: 13px;
	color: var(--text);
}
.erp-crew-transit-pills{
	display:flex;
	flex-wrap:wrap;
	gap: 8px;
}
.erp-crew-mobile-group{
	display:none;
}
.erp-crew-cell-desc{
	margin-top: 2px;
	font-size: 12px;
	line-height: 1.3;
	font-weight: 500;
	color: var(--muted);
}
.erp-crew-os-penalty{
	margin: 8px 0 2px;
	padding: 10px 12px;
	border: 1px solid rgba(220, 38, 38, .22);
	border-left: 4px solid var(--danger);
	border-radius: 12px;
	background: rgba(220, 38, 38, .045);
	font-size: 11px;
	line-height: 1.25;
	color: var(--muted);
}
.erp-crew-os-penalty-title{
	margin: 0 0 3px;
	font-size: 12px;
	font-weight: 900;
	color: var(--danger);
}
.erp-crew-os-penalty-formula{
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 700;
	color: var(--muted);
}
.erp-crew-os-penalty-grid{
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
}
.erp-crew-os-penalty-grid > div{
	padding: 7px 8px;
	border: 1px solid var(--border);
	border-radius: 9px;
	background: var(--panel);
}
.erp-crew-os-penalty-grid span{
	display:block;
	margin-bottom: 2px;
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .02em;
	color: var(--muted);
}
.erp-crew-os-penalty-grid strong{
	display:block;
	font-size: 11px;
	color: var(--text);
	white-space: nowrap;
}
@media (max-width: 720px){
	.erp-crew-os-penalty-grid{
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px){
	.erp-crew-results-section > .erp-row:first-child{
		align-items: stretch !important;
		gap: 10px;
	}
	.erp-crew-results-section > .erp-row:first-child > .erp-row{
		width: 100%;
		justify-content: stretch;
	}
	.erp-crew-results-section > .erp-row:first-child > .erp-row .erp-btn{
		flex: 1 1 auto;
	}
	.erp-crew-result-subhead{
		margin: 16px 0 8px;
	}
	.erp-crew-transit-list{
		margin: 0 0 10px;
	}
	.erp-crew-transit-head{
		align-items:flex-start;
		flex-direction:column;
		gap: 2px;
	}
	.erp-crew-result-tablewrap{
		padding-left: 0;
		padding-right: 0;
	}
	.erp-crew-result-table tbody{
		gap: 8px;
	}
	.erp-crew-result-table tbody tr{
		background: var(--panel);
	}
	.erp-crew-result-table tbody tr.erp-crew-mobile-group{
		display:block;
		padding: 0;
		border: 0;
		background: transparent;
		margin: 8px 0 -4px;
	}
	.erp-crew-result-table tbody tr.erp-crew-mobile-group td{
		padding: 0;
		border: 0;
	}
	.erp-crew-mobile-title-card{
		padding: 10px 12px;
		border: 1px solid rgba(0,189,0,0.30);
		border-left: 4px solid var(--accent);
		border-radius: var(--r2);
		background: var(--accentSoft);
	}
	.erp-crew-mobile-title-main{
		font-size: 14px;
		font-weight: 950;
		line-height: 1.25;
	}
	.erp-crew-mobile-title-sub{
		margin-top: 3px;
		font-size: 12px;
		line-height: 1.35;
		color: var(--muted2);
	}
	.erp-crew-result-table tbody tr.erp-crew-mobile-gap{
		display:none;
	}
	.erp-crew-result-table tbody td[data-label]{
		display:grid;
		grid-template-columns: minmax(104px, 40%) minmax(0, 1fr);
		gap: 10px;
		align-items:start;
	}
	.erp-crew-result-table tbody td[data-label]::before{
		content: attr(data-label);
		font-size: 11px;
		line-height: 1.25;
		letter-spacing: .02em;
		text-transform: uppercase;
		font-weight: 900;
		color: var(--muted);
	}
	.erp-crew-result-table tbody td.erp-crew-result-wide{
		display:block;
	}
	.erp-crew-result-table tbody td.erp-crew-result-wide::before{
		display:block;
		margin: 0 0 7px;
	}
}

.erp-badge{
	display:inline-block;
	margin-left: 8px;
	padding: 4px 8px;
	border-radius: 999px;
	font-size: 12px;
	border: 1px solid rgba(0,189,0,0.35);
	background: var(--accentSoft);
}

.erp-badge-danger{
	display:inline-block;
	margin-left: 8px;
	padding: 4px 8px;
	border-radius: 999px;
	font-size: 12px;
	border: 1px solid rgba(220,38,38,0.35);
	background: rgba(220,38,38,0.08);
	color: #b91c1c;
}

.erp-badge-warn{
	display:inline-block;
	margin-left: 8px;
	padding: 4px 8px;
	border-radius: 999px;
	font-size: 12px;
	border: 1px solid rgba(180,83,9,0.35);
	background: var(--warnSoft);
	color: var(--warn);
}

/* scanlog alerts badge (kółeczko na przycisku) */
.erp-btn.has-badge{
	position: relative;
	padding-right: 42px; /* miejsce na kółeczko */
}

.erp-badge-circle{
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 22px;
	height: 22px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	border: 1px solid rgba(0,189,0,0.35);
	background: var(--accentSoft);
	color: inherit;
}

.erp-badge-circle.is-bad{
	border: 1px solid rgba(220,38,38,0.35);
	background: rgba(220,38,38,0.08);
	color: #b91c1c;
}

.erp-text-danger{ color: #b91c1c; }
.erp-place-icon{ margin-left:6px; }
.erp-crew-inline{ display:none; }

.erp-crew-alert-badge{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	min-width:20px;
	height:20px;
	padding:0 6px;
	margin-left:8px;
	border-radius:999px;
	font-size:11px;
	font-weight:700;
	line-height:1;
	border:1px solid rgba(0,189,0,0.35);
	background: var(--accentSoft);
	color:#166534;
	vertical-align:middle;
}

.erp-crew-alert-badge.is-bad{
	border:1px solid rgba(220,38,38,0.35);
	background: rgba(220,38,38,0.08);
	color:#b91c1c;
}

.erp-crew-alert-badge.is-ok{
	border:1px solid rgba(0,189,0,0.35);
	background: var(--accentSoft);
	color:#166534;
}

.erp-crew-bk-badge{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	gap:4px;
	height:22px;
	padding:0 7px;
	border-radius:999px;
	font-size:11px;
	font-weight:850;
	line-height:1;
	border:1px solid var(--border);
	background:var(--panel2);
	color:var(--muted);
	vertical-align:middle;
	white-space:nowrap;
}

.erp-crew-bk-badge.is-ok{
	border-color:rgba(0,189,0,0.35);
	background:var(--accentSoft);
	color:#166534;
}

.erp-crew-bk-badge.is-bad{
	border-color:rgba(220,38,38,0.35);
	background:rgba(220,38,38,0.08);
	color:#b91c1c;
}

.erp-crew-bk-badge.is-empty{
	border-color:rgba(107,114,128,0.25);
	background:rgba(107,114,128,0.07);
	color:var(--muted);
}

.erp-crew-bk-label{
	font-size:10px;
	letter-spacing:.02em;
}

.erp-crew-bk-icon{
	font-size:12px;
	line-height:1;
}

.erp-penalty-sum{
	color:#b91c1c;
	font-size:10px;
	line-height:1.1;
	margin-top:4px;
}

@media print{
	/* NIE ustawiamy @page, żeby zostawić domyślne marginesy drukarki */

	html, body{
		background:#fff !important;
		color:#000 !important;
		font-size:11px !important;
		line-height:1.15 !important;
		margin:0 !important;
		padding:15px !important;
	}

	.erp-noprint{ display:none !important; }

	/* każda klasa (nagłówek + tabela) na nowej stronie */
	.erp-title{
		break-before: page;
		page-break-before: always;

		margin:6px 0 4px !important;
		padding:0 !important;
		border:none !important;
		box-shadow:none !important;
		font-size:14px !important;
		font-weight:700 !important;
	}

	/* ale NIE rób nowej strony przed pierwszą klasą */
	.erp-title:first-of-type{
		break-before: auto;
		page-break-before: auto;
	}

	.erp-muted{ opacity:0.75 !important; color:#000 !important; }
	.erp-crew-inline{ display:inline !important; }
	.erp-crew-extra{ display:none !important; }
	.erp-place-icon{ display:none !important; }

	.erp-table{
		border:none !important;
		border-radius:0 !important;
		box-shadow:none !important;
		background:transparent !important;
		margin:0 0 10px 0 !important;

		break-inside: avoid;
		page-break-inside: avoid;
	}

	.erp-thead, .erp-trow{
		grid-template-columns: var(--erp-cols-print, var(--erp-cols, 52px 1fr 1fr 110px));
		gap:0 !important;
	}

	.erp-thead{
		font-weight:700 !important;
		font-size:12px !important;
		color:#000 !important;
		background:transparent !important;
		border-bottom:1px solid #000 !important;
		padding:0 !important;
	}

	.erp-thead > div, .erp-trow > div{
		padding:3px 5px !important;
	}

	.erp-trow{
		border:none !important;
		border-bottom:1px solid #ddd !important;
		border-radius:0 !important;
		box-shadow:none !important;
		background:transparent !important;
		margin:0 !important;
		padding:0 !important;

		break-inside: avoid;
		page-break-inside: avoid;
	}

	/* badge’e na wydruku = zwykły tekst */
	.erp-badge,
	.erp-badge-danger{
		border:none !important;
		background:transparent !important;
		color:#000 !important;
		padding:0 !important;
		margin:0 !important;
		font-size:12px !important;
		border-radius:0 !important;
	}

	.erp-text-danger{ color:#000 !important; } /* bez czerwieni na wydruku */
	.erp-penalty-sum{
		color:#000 !important;
		font-size:10px !important;
		margin-top:2px !important;
	}
}

/* ===== FOOTER ===== */
.erp-footer{
	max-width: var(--max);
	margin: 14px auto 0;
	padding: 10px 4px 0;
	display:flex;
	justify-content:space-between;
	color: var(--muted2);
}

/* ===== BOTTOM NAV (MOBILE) ===== */
.erp-bottom{
	position: fixed;
	left: 0; right: 0; bottom: 0;
	padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
	background: var(--header);
	border-top: 1px solid var(--border);
	display:grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	z-index: 45;
	box-shadow: var(--shadowSm);
}
.erp-bitem{
	min-height: 42px;
	border-radius: var(--r2);
	border: 1px solid var(--border);
	background: var(--panel);
	display:flex;
	align-items:center;
	justify-content:center;
	padding: 0 6px;
	font-size: 11px;
	font-weight: 850;
	line-height: 1;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.erp-bitem.is-active{
	border-color: rgba(0,189,0,0.45);
	background: var(--accentSoft);
}

/* ===== DESKTOP ===== */
@media (min-width: 980px){
	:root{ --max: min(1600px, 96vw); }

	.erp-main{ padding: 18px 16px 18px; }
	.erp-bottom{ display:none; }

	/* dashboard: 3 kolumny + DUŻE kafle + szeroki obszar */
	.erp-view[data-view="dashboard"]{
		width: min(1600px, 98vw);
		max-width: none;
	}
	.erp-view[data-view="dashboard"] > .erp-card{
		width: 100%;
		max-width: 100%;
		min-width: 0;
		box-sizing: border-box;
	}
	.erp-tiles{
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 18px;
	}
	.erp-tile{
		padding: 30px;
		min-height: 170px;
	}
	.erp-tile-title{ font-size: 22px; }
	.erp-tile-meta{ font-size: 14px; }
}
@media (max-width: 768px){
	.erp-view[data-view="dashboard"] > .erp-card{
		width: 100% !important;
		margin-left: 0;
		margin-right: 0;
	}
}
/* ===== LOGIN (AUTH) ===== */
.erp-top-auth{
	justify-content: center;
}

.erp-auth{
	min-height: 100dvh;
	display:flex;
	flex-direction:column;
	background: var(--bg);
}

.erp-auth-main{
	flex: 1;
	display:flex;
	align-items:center;
	justify-content:center;
	padding: 18px 12px 24px;
}

.erp-auth-card{
	width: min(520px, 100%);
	border: 1px solid var(--border);
	border-radius: var(--r2);
	background: var(--panel);
	box-shadow: var(--shadow);
	padding: 18px;
}

.erp-auth-h1{
	margin: 0;
	font-size: 20px;
	font-weight: 850;
}

.erp-auth-p{
	margin: 6px 0 14px;
	color: var(--muted);
}

.erp-auth-form{
	display:flex;
	flex-direction:column;
	gap: 12px;
}

.erp-check{
	display:flex;
	gap: 10px;
	align-items:center;
	color: var(--muted);
	user-select:none;
}
.erp-check input{
	width: 18px;
	height: 18px;
}

.erp-btn-primary{
	border-color: rgba(0,189,0,0.35);
	background: var(--accentSoft);
}

.erp-btn-blue{
	border-color: rgba(37,99,235,0.35);
	background: rgba(37,99,235,0.12);
}
.erp-btn-blue:hover{
	background: rgba(37,99,235,0.16);
}
.erp-btn-blue:disabled{
	background: rgba(37,99,235,0.08);
}

.erp-btn-green{
	border-color: rgba(0, 150, 60, .38);
	background: rgba(0, 189, 0, .14);
	color: #047857;
	font-weight: 900;
}
.erp-btn-green:hover{
	background: rgba(0, 189, 0, .20);
}

.erp-btn-purple{
	border-color: rgba(124, 58, 237, .35);
	background: rgba(124, 58, 237, .12);
	color: #6d28d9;
	font-weight: 900;
}
.erp-btn-purple:hover{
	background: rgba(124, 58, 237, .18);
}

.erp-btn-orange{
	border-color: rgba(234, 88, 12, .38);
	background: rgba(234, 88, 12, .12);
	color: #c2410c;
	font-weight: 900;
}
.erp-btn-orange:hover{
	background: rgba(234, 88, 12, .18);
}

.erp-btn-slate{
	border-color: rgba(71, 85, 105, .35);
	background: rgba(71, 85, 105, .12);
	color: #334155;
	font-weight: 900;
}
.erp-btn-slate:hover{
	background: rgba(71, 85, 105, .18);
}

.erp-crew-actions .erp-btn{
	box-shadow: 0 2px 8px rgba(17,24,39,.05);
}
.erp-crew-actions .erp-btn:disabled{
	opacity: .50;
	filter: grayscale(.18);
	background-image: repeating-linear-gradient(
		-45deg,
		rgba(255,255,255,.18) 0,
		rgba(255,255,255,.18) 6px,
		transparent 6px,
		transparent 12px
	);
}

.erp-auth-links{
	display:flex;
	justify-content:center;
	gap: 10px;
	margin-top: 6px;
	color: var(--muted);
}

.erp-link{
	color: var(--muted);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.erp-sep{ color: var(--muted2); }

.erp-auth-note{
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--border);
	color: var(--muted2);
	font-size: 12px;
	text-align:center;
}

.erp-auth-footer{
	padding: 10px 12px calc(env(safe-area-inset-bottom) + 10px);
	border-top: 1px solid var(--border);
	background: var(--header);
	display:flex;
	justify-content:space-between;
	color: var(--muted2);
}
/* ===== ALERTS (LOGIN FEEDBACK) ===== */
.erp-alert{
	border: 1px solid var(--border);
	background: var(--panel2);
	border-radius: var(--r2);
	padding: 12px 12px;
	margin: 10px 0 0;
	box-shadow: var(--shadowSm);
	font-weight: 650;
}

.erp-alert-error{
	border-color: rgba(220,38,38,0.35);
	background: rgba(220,38,38,0.08);
	color: #7f1d1d;
}

.erp-alert-ok{
	border-color: rgba(0,189,0,0.35);
	background: var(--accentSoft);
	color: #14532d;
}
/* ===== FOOTER (jak w panelu zawodnika) ===== */
footer{
	margin-top: auto;
	width: 100%;
	background: var(--header);
	border-top: 1px solid var(--border);
	box-shadow: var(--shadowSm);
	padding: 12px 0 calc(env(safe-area-inset-bottom) + 12px);
	color: var(--muted2);
	height: 8vh;
}

.container{
	max-width: var(--max);
	margin: 0 auto;
	padding: 0 12px;
}

.card{
	border: 1px solid var(--border);
	border-radius: var(--r2);
	background: var(--panel);
	box-shadow: var(--shadowSm);
}

.footer-card{
	background: transparent;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.footer-grid{
	display: grid;
	grid-template-columns: 56px 1fr 1.2fr;
	gap: 10px;
	align-items: center;
}

.footer-left{
	display: flex;
	align-items: center;
	justify-content: flex-start;
}

.footer-center{
	text-align: center;
	color: var(--muted);
	font-size: 13px;
}

.footer-version{
	display: inline-block;
	margin-top: 2px;
	font-size: 12px;
	color: var(--muted2);
}

.footer-right{
	text-align: right;
	color: var(--muted);
	font-size: 13px;
}

.footer-right a{
	color: var(--text);
	text-decoration: none;
	border-bottom: 1px solid var(--border);
	padding-bottom: 1px;
}

.footer-right a:hover{
	border-bottom-color: var(--text);
}

.footer-logo{
	height: 5vh;
	display: block;
	object-fit: contain;
}

@media (max-width: 720px){
	.footer-grid{
		grid-template-columns: 1fr;
		text-align: center;
	}
	.footer-left{ justify-content: center; }
	.footer-right{ text-align: center; }
}
/* A2HS tile (mobile dashboard) */
.erp-tile-install{
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	text-align: left;
	cursor: pointer;
}
@media (min-width: 980px){
	.erp-tile-install{ display: none !important; }
}

/* ===== PŁYNNE PRZEJŚCIA WIDOKÓW (CSS-only, animacja wejścia) ===== */
@media (prefers-reduced-motion: no-preference){
	.erp-view:not([hidden]){
		animation: erpViewIn .45s ease-out both;
	}

	@keyframes erpViewIn{
		from{ opacity:0; transform: translateY(8px); }
		to  { opacity:1; transform: translateY(0); }
	}

	/* subtelnie: karty/sekcje też płynnie “siadają” */
	.erp-view:not([hidden]) .erp-card{
		animation: erpCardIn .45s ease-out both;
	}
	@keyframes erpCardIn{
		from{ opacity:0; transform: translateY(6px); }
		to  { opacity:1; transform: translateY(0); }
	}
}

/* ===== KREATOR TRAS: wyrównania form ===== */
.erp-view[data-view="kreator_tras"] .erp-formrow,
.erp-view[data-view="kreator_tras"] .erp-row{
	align-items: stretch;
}

.erp-view[data-view="kreator_tras"] .erp-field input,
.erp-view[data-view="kreator_tras"] .erp-field select{
	height: 40px;
}

.erp-view[data-view="kreator_tras"] .erp-btn{
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* ===== NFC pane ===== */
.erp-nfc-pane .erp-card{ width: 100%; }

/* ===== QR EMULATOR: layout + overflow fix ===== */
.erp-qr-grid{
	display: grid;
	grid-template-columns: 360px minmax(0, 1fr);
	gap: 16px;
	align-items: start;
}

/* mobile */
@media (max-width: 980px){
	.erp-qr-grid{
		grid-template-columns: 1fr;
	}
}

.erp-qr-img{
	width: 100%;
	max-width: 340px;
	aspect-ratio: 1 / 1;
	height: auto;
	object-fit: contain;
	border-radius: 12px;
	display: block;
}

/* payload MUST NOT push container width */
.erp-qr-payload{ min-width: 0; }
.erp-qr-payloadtext{
	white-space: normal !important;   /* override .erp-mono if it uses nowrap */
	overflow-wrap: anywhere;
	word-break: break-word;
}

/* expired state (optional visual) */
.erp-qr-expired .erp-qr-img{
	opacity: 0.25;
	filter: grayscale(1);
}

/* ===== TRACKING: mini podsumowania ===== */
.erp-grid2{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); }
@media (max-width: 820px){ .erp-grid2{ grid-template-columns:1fr; } }
.erp-mini{ border:1px solid #e5e7eb; border-radius:14px; padding:10px 12px; background:#fff; box-shadow: 0 1px 6px rgba(0,0,0,0.05); }
.erp-mini-ttl{ font-size:12px; font-weight:850; color:#6b7280; margin-bottom:6px; }
.erp-mini-val{ font-size:22px; font-weight:900; line-height:1.1; }
.erp-mini-sub{ font-size:12px; color:#6b7280; margin-top:4px; }

.erp-card-embedded{
	padding:0;
	overflow:hidden;
}

.erp-card-embedded .erp-cardhead{
	padding:16px 18px 12px;
	border-bottom:1px solid rgba(255,255,255,0.08);
}

.erp-embed-frame-wrap{
	width:100%;
	height:calc(100vh - 250px);
	min-height:720px;
	background:#0f172a;
}

.erp-embed-frame{
	display:block;
	width:100%;
	height:100%;
	border:0;
	background:#ffffff;
}

@media (max-width: 991px){
	.erp-embed-frame-wrap{
		height:calc(100vh - 220px);
		min-height:640px;
	}
}

@media (max-width: 767px){
	.erp-card-embedded .erp-cardhead{
		padding:14px 14px 10px;
	}
	.erp-embed-frame-wrap{
		height:calc(100vh - 190px);
		min-height:560px;
	}
}

.erp-card-embedded{
	padding:0;
	overflow:hidden;
}

.erp-embed-frame-wrap{
	width:100%;
	height:calc(100vh - 250px);
	min-height:720px;
	background:#0f172a;
}

.erp-embed-frame{
	display:block;
	width:100%;
	height:100%;
	border:0;
	background:#ffffff;
}

@media (max-width: 991px){
	.erp-embed-frame-wrap{
		height:calc(100vh - 220px);
		min-height:640px;
	}
}

@media (max-width: 767px){
	.erp-embed-frame-wrap{
		height:calc(100vh - 190px);
		min-height:560px;
	}
}

/* ===== DASHBOARD: zdrowie systemu ===== */
.erp-health-grid{
	display:grid;
	grid-template-columns:repeat(3,minmax(0,1fr));
	gap:12px;
}
.erp-health-item{
	border:1px solid rgba(0,0,0,0.10);
	border-radius:14px;
	background:#fff;
	padding:14px;
	box-shadow:0 8px 18px rgba(0,0,0,0.05);
}
.erp-health-label{
	font-size:12px;
	color:#6b7280;
	margin-bottom:6px;
}
.erp-health-value{
	font-size:26px;
	font-weight:900;
	line-height:1.1;
}
.erp-health-value.is-ok{ color:#166534; }
.erp-health-value.is-warn{ color:#b45309; }
.erp-health-value.is-bad{ color:#b91c1c; }

@media (max-width: 900px){
	.erp-health-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px){
	.erp-health-grid{ grid-template-columns:1fr; }
}

/* ===== NFC: beta grid ===== */
.erp-nfc-beta-grid{
	display:flex;
	flex-direction:column;
	gap:14px;
}
.erp-nfc-beta-stage{
	border:1px solid rgba(0,0,0,0.10);
	border-radius:16px;
	background:#fff;
	box-shadow:0 8px 18px rgba(0,0,0,0.05);
	overflow:hidden;
}
.erp-nfc-beta-stagehead{
	padding:12px 14px;
	font-size:14px;
	font-weight:900;
	border-bottom:1px solid rgba(0,0,0,0.08);
	background:#f9fafb;
}
.erp-nfc-beta-rows{
	display:flex;
	flex-direction:column;
}
.erp-nfc-beta-row{
	display:grid;
	grid-template-columns:220px 1fr;
	gap:12px;
	padding:12px 14px;
	border-top:1px solid rgba(0,0,0,0.06);
	align-items:start;
}
.erp-nfc-beta-row:first-child{ border-top:0; }
.erp-nfc-beta-rowlabel{
	font-size:12px;
	font-weight:800;
	color:#374151;
	padding-top:8px;
}
.erp-nfc-beta-pills{
	display:flex;
	flex-wrap:wrap;
	gap:8px;
}
.erp-nfc-beta-pill{
	border:1px solid rgba(0,0,0,0.10);
	border-radius:999px;
	background:#f3f4f6;
	color:#111827;
	padding:8px 12px;
	font-size:12px;
	font-weight:800;
	cursor:pointer;
	transition:.15s ease;
}
.erp-nfc-beta-pill:hover{
	transform:translateY(-1px);
	box-shadow:0 8px 16px rgba(0,0,0,0.08);
}
.erp-nfc-beta-pill .meta{
	display:block;
	font-size:11px;
	font-weight:600;
	opacity:.8;
	margin-top:2px;
}
.erp-nfc-beta-pill.is-empty{
	background:#e5e7eb;
	color:#4b5563;
}
.erp-nfc-beta-pill.is-ok{
	background:#dcfce7;
	border-color:#86efac;
	color:#166534;
}
.erp-nfc-beta-pill.is-replaced{
	background:#ffedd5;
	border-color:#fdba74;
	color:#9a3412;
}

@media (max-width: 720px){
	.erp-nfc-beta-row{
		grid-template-columns:1fr;
	}
	.erp-nfc-beta-rowlabel{
		padding-top:0;
	}
}

.erp-nfc-beta-topcard{
	border:1px solid rgba(59,130,246,0.18);
}

.erp-gps-pill{
	margin-left:0;
}

.erp-gps-pill.is-good{
	border:1px solid rgba(0,189,0,0.35);
	background:var(--accentSoft);
	color:var(--accent);
}

.erp-gps-pill.is-warn{
	border:1px solid rgba(180,83,9,0.35);
	background:var(--warnSoft);
	color:var(--warn);
}

.erp-gps-pill.is-bad{
	border:1px solid rgba(220,38,38,0.35);
	background:rgba(220,38,38,0.08);
	color:#b91c1c;
}

.erp-gps-meta{
	font-size:12px;
}

.erp-gps-live-row{
	align-items:center;
}

.erp-nfc-beta-pill.is-selected{
	outline:2px solid #2563eb;
	outline-offset:1px;
	box-shadow:0 10px 20px rgba(37,99,235,0.18);
	transform:translateY(-1px);
}

.erp-nfc-beta-pill.is-selected .meta{
	opacity:1;
}

@media (max-width: 720px){
	.erp-nfc-beta-topcard .erp-cardhead{
		flex-direction:column;
		align-items:stretch;
	}
}

@media (max-width: 720px){
	.erp-view[data-view="sedziowie_nfc_programator_beta"]{
		/*width:calc(100vw - 8px);*/
		max-width:none;
		/*margin-left:-8px;*/
		margin-right:0;
		gap:8px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] > .erp-card{
		width:100%;
		max-width:none;
		border-radius:12px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-card .erp-card{
		width:100%;
		max-width:100%;
		border-radius:12px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-cardhead{
		flex-direction:column;
		align-items:stretch;
		gap:10px;
		padding:10px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-pad{
		padding:10px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-cardhead > div{
		width:100%;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-cardhead .erp-row{
		flex-direction:column;
		align-items:stretch !important;
		justify-content:flex-start !important;
		gap:8px !important;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-cardhead .erp-field,
	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-cardhead .erp-select,
	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-cardhead .erp-btn{
		width:100%;
		min-width:0 !important;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-detail-grid{
		gap:8px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-kvitem{
		padding:10px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-tablewrap{
		overflow-x:auto;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-grid{
		gap:10px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-stage{
		border-radius:12px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-stagehead{
		padding:10px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-row{
		grid-template-columns:1fr;
		gap:8px;
		padding:10px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-rowlabel{
		padding-top:0;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-pills{
		display:grid;
		grid-template-columns:repeat(2, minmax(0, 1fr));
		gap:8px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-pill{
		width:100%;
		text-align:center;
		padding:9px 8px;
		white-space:normal;
		overflow-wrap:anywhere;
	}
}

@media (max-width: 420px){
	.erp-view[data-view="sedziowie_nfc_programator_beta"]{
		width:calc(100vw - 4px);
		margin-left:-10px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-cardhead,
	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-pad{
		padding:8px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-row{
		padding:8px;
	}

	.erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-pills{
		grid-template-columns:repeat(2, minmax(0, 1fr));
	}
}

/* ===== NFC MAPA: opisy punktów + pozycja użytkownika ===== */
.erp-map-legend .dot.user{
	background:#111827;
	box-shadow: inset 0 0 0 4px #60a5fa;
}

.erp-map-icon.user{
	background:#111827;
	position:relative;
}
.erp-map-icon.user::after{
	content:"";
	position:absolute;
	inset:4px;
	border-radius:999px;
	background:#60a5fa;
}

.leaflet-tooltip.erp-map-taglabel{
	background:#fff;
	border:1px solid rgba(17,24,39,0.14);
	color:#111827;
	border-radius:999px;
	box-shadow:0 6px 16px rgba(0,0,0,0.18);
	padding:2px 8px;
	font-size:11px;
	font-weight:800;
	line-height:1.25;
}
.leaflet-tooltip-top.erp-map-taglabel:before,
.leaflet-tooltip-bottom.erp-map-taglabel:before,
.leaflet-tooltip-left.erp-map-taglabel:before,
.leaflet-tooltip-right.erp-map-taglabel:before{
	display:none;
}
.erp-map.erp-map-dragging .leaflet-tooltip.erp-map-taglabel{
	display:none !important;
}
@media (max-width: 768px){
	.leaflet-tooltip.erp-map-taglabel{
		font-size:10px;
		padding:2px 6px;
		max-width:140px;
		white-space:normal;
		text-align:center;
	}
}

/* ===== NFC GPS EDIT ===== */
.erp-gpsedit-shell{
	align-items:flex-start;
}

.erp-gpsedit-mapcol{
	flex:1 1 100%;
	min-width:320px;
}

.erp-gpsedit-side{
	flex:1 1 100%;
	min-width:0;
}

.erp-map-icon.editing{
	background:#111827;
	box-shadow:0 0 0 3px rgba(220,38,38,0.25);
}
.erp-map-icon.editing::after{
	content:"";
	position:absolute;
	inset:4px;
	border-radius:999px;
	background:#ef4444;
}

.erp-gpsedit-popupactions{
	display:flex;
	gap:8px;
	margin-top:10px;
	flex-wrap:wrap;
}

.erp-gpsedit-actions{
	display:flex;
	gap:10px;
	flex-wrap:wrap;
	align-items:stretch;
}

.erp-gpsedit-actions .erp-btn{
	flex:1 1 180px;
	justify-content:center;
}

.erp-gpsedit-help{
	line-height:1.45;
	white-space:normal;
	word-break:break-word;
}

@media (max-width: 980px){
	.erp-gpsedit-mapcol{
		flex:1 1 100%;
		min-width:0;
	}

	.erp-gpsedit-side{
		flex:1 1 100%;
		min-width:0;
	}
}

.erp-gpsimport-status.is-ok{
	border-color:rgba(0,189,0,0.35);
	background:var(--accentSoft);
	color:var(--accent);
}

.erp-gpsimport-status.is-warn{
	border-color:rgba(180,83,9,0.35);
	background:var(--warnSoft);
	color:var(--warn);
}

.erp-gpsimport-status.is-bad{
	border-color:rgba(220,38,38,0.35);
	background:rgba(220,38,38,0.08);
	color:#b91c1c;
}

.erp-gpsimport-tagcell{
	display:flex;
	flex-direction:column;
	gap:4px;
}

.erp-gpsimport-pointname{
	font-weight:700;
}

.erp-gpsimport-help{
	margin-top:4px;
}

.erp-gpsimport-tablewrap{
	padding-top:0;
}

.erp-gpsimport-table .erp-select{
	min-width:220px;
	width:100%;
}

.erp-gpsimport-status{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	padding:4px 8px;
	border-radius:999px;
	font-size:12px;
	font-weight:800;
	white-space:nowrap;
	border:1px solid var(--border);
	background:var(--panel2);
	color:var(--text);
}
.erp-gpsimport-status.is-ok{border-color:rgba(0,189,0,0.35);background:var(--accentSoft);color:var(--accent);}
.erp-gpsimport-status.is-warn{border-color:rgba(180,83,9,0.35);background:var(--warnSoft);color:var(--warn);}
.erp-gpsimport-status.is-bad{border-color:rgba(220,38,38,0.35);background:rgba(220,38,38,0.08);color:#b91c1c;}
.erp-gpsimport-status.is-muted{border-color:var(--border);background:var(--panel2);color:var(--muted);}
.erp-gpsimport-tagcell{display:flex;flex-direction:column;gap:4px;}
.erp-gpsimport-pointname{font-weight:700;}
.erp-gpsimport-help{margin-top:4px;}

/* ===== PROGRAMATOR NFC: pełna szerokość na telefonie ===== */
@media (max-width: 720px){
	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-main{
		padding-left:1vw !important;
		padding-right:1vw !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-pagehead{
		width:98vw !important;
		max-width:98vw !important;
		margin-left:auto !important;
		margin-right:auto !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"]{
		width:98vw !important;
		max-width:98vw !important;
		margin-left:auto !important;
		margin-right:auto !important;
		gap:2vw !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] *,
	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"]{
		box-sizing:border-box;
		min-width:0;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-card{
		width:100% !important;
		max-width:100% !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] > .erp-card{
		border-radius:3vw;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-cardhead,
	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-pad{
		padding:2.5vw !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-cardhead{
		flex-direction:column !important;
		align-items:stretch !important;
		gap:2.5vw !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-cardhead > div,
	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-row,
	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-field,
	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-select,
	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-btn{
		width:100% !important;
		max-width:100% !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-row{
		flex-direction:column !important;
		align-items:stretch !important;
		justify-content:flex-start !important;
		gap:2vw !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-detail-grid{
		grid-template-columns:1fr !important;
		gap:2vw !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-kvitem{
		padding:2.5vw !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-tablewrap{
		padding:0 2.5vw 2.5vw !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-grid{
		gap:2.5vw !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-stage{
		border-radius:3vw !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-stagehead{
		padding:2.5vw !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-row{
		grid-template-columns:1fr !important;
		gap:2vw !important;
		padding:2.5vw !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-pills{
		display:grid !important;
		grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
		gap:2vw !important;
	}

	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-pill{
		width:100% !important;
		max-width:100% !important;
		text-align:center;
		white-space:normal;
		overflow-wrap:anywhere;
		padding:2.2vw 1.8vw !important;
	}
}

@media (max-width: 380px){
	html[data-erp-current-route="sedziowie_nfc_programator_beta"] .erp-view[data-view="sedziowie_nfc_programator_beta"] .erp-nfc-beta-pills{
		grid-template-columns:1fr !important;
	}
}

/* ===== AUDIT LOG: kompaktowe karty mobilne ===== */
@media (max-width: 720px){
	.erp-view[data-view="audit_log"] .erp-cardhead{
		padding:2.5vw !important;
		gap:2vw !important;
	}

	.erp-view[data-view="audit_log"] .erp-cardtitle{
		font-size:16px;
		line-height:1.2;
	}

	.erp-view[data-view="audit_log"] .erp-cardhead .erp-muted{
		font-size:12px;
		line-height:1.25;
	}

	.erp-view[data-view="audit_log"] .erp-cardhead .erp-row{
		width:100%;
	}

	.erp-view[data-view="audit_log"] .erp-cardhead .erp-btn{
		width:100%;
		min-width:0 !important;
	}

	.erp-view[data-view="audit_log"] .erp-formrow{
		padding:2vw 2.5vw 2.5vw !important;
	}

	.erp-view[data-view="audit_log"] .erp-tablewrap{
		padding:0 2.5vw 2.5vw !important;
	}

	#erpAuditTable tbody,
	#erpCrewAuditTable tbody{
		gap:2vw !important;
	}

	#erpAuditTable tbody tr[data-search],
	#erpCrewAuditTable tbody tr[data-search]{
		display:grid !important;
		grid-template-columns:minmax(0, .75fr) minmax(0, 1.25fr);
		gap:0;
		padding:8px 10px !important;
		border-radius:14px !important;
		background:var(--panel2);
	}

	#erpAuditTable tbody tr[data-search] td,
	#erpCrewAuditTable tbody tr[data-search] td{
		display:block !important;
		min-width:0;
		padding:6px 6px !important;
		border:0 !important;
		font-size:13px;
		line-height:1.25;
	}

	#erpAuditTable tbody tr[data-search] td:nth-child(1),
	#erpAuditTable tbody tr[data-search] td:nth-child(2),
	#erpCrewAuditTable tbody tr[data-search] td:nth-child(1),
	#erpCrewAuditTable tbody tr[data-search] td:nth-child(2){
		border-bottom:1px dashed var(--border) !important;
	}

	#erpAuditTable tbody tr[data-search] td:nth-child(3),
	#erpAuditTable tbody tr[data-search] td:nth-child(4),
	#erpAuditTable tbody tr[data-search] td:nth-child(5),
	#erpAuditTable tbody tr[data-search] td:nth-child(6),
	#erpCrewAuditTable tbody tr[data-search] td:nth-child(3),
	#erpCrewAuditTable tbody tr[data-search] td:nth-child(4),
	#erpCrewAuditTable tbody tr[data-search] td:nth-child(5),
	#erpCrewAuditTable tbody tr[data-search] td:nth-child(6){
		grid-column:1 / -1;
		border-bottom:1px dashed var(--border) !important;
	}

	#erpAuditTable tbody tr[data-search] td:last-child,
	#erpCrewAuditTable tbody tr[data-search] td:last-child{
		border-bottom:0 !important;
	}

	#erpAuditTable tbody tr[data-search] td[data-label]::before,
	#erpCrewAuditTable tbody tr[data-search] td[data-label]::before{
		content:attr(data-label);
		display:block;
		margin-bottom:2px;
		font-size:10px;
		line-height:1.1;
		font-weight:900;
		letter-spacing:.04em;
		text-transform:uppercase;
		color:var(--muted2);
	}

	#erpAuditTable tbody tr[data-search] .erp-kv,
	#erpCrewAuditTable tbody tr[data-search] .erp-kv{
		gap:2px;
	}

	#erpAuditTable tbody tr[data-search] strong,
	#erpCrewAuditTable tbody tr[data-search] strong{
		font-size:13px;
		line-height:1.2;
	}

	#erpAuditTable tbody tr[data-search] .erp-small,
	#erpCrewAuditTable tbody tr[data-search] .erp-small{
		font-size:11px;
		line-height:1.25;
	}

	#erpAuditTable tbody tr[data-search] td:nth-child(6) .erp-small,
	#erpCrewAuditTable tbody tr[data-search] td:nth-child(6) .erp-small{
		max-height:42px;
		overflow:hidden;
		word-break:break-word;
	}

	#erpAuditTable tbody tr[data-search] td:nth-child(1) strong,
	#erpCrewAuditTable tbody tr[data-search] td:nth-child(1) strong{
		font-size:15px;
	}

	#erpAuditTable tbody tr[data-search] td:nth-child(2) strong,
	#erpCrewAuditTable tbody tr[data-search] td:nth-child(2) strong{
		font-size:12px;
	}
}

/* ===== WIDOK ZAŁOGI: zwijany audit log ===== */
.erp-crew-audit-section{
	padding:0;
}

.erp-crew-audit-head{
	gap:12px;
}

.erp-crew-audit-head > div:first-child{
	min-width:0;
}

.erp-crew-audit-box{
	margin-top:12px;
}

.erp-crew-audit-box[hidden]{
	display:none !important;
}

.erp-crew-audit-toolbar{
	gap:10px;
}

@media (max-width: 720px){
	.erp-crew-audit-section{
		padding:0;
	}

	.erp-crew-audit-head{
		flex-direction:column;
		align-items:stretch !important;
		gap:8px;
	}

	.erp-crew-audit-head .erp-btn{
		width:100%;
	}

	.erp-crew-audit-box{
		margin-top:10px;
	}

	.erp-crew-audit-toolbar{
		flex-direction:column;
		align-items:stretch !important;
		gap:8px;
	}

	.erp-crew-audit-toolbar > .erp-row{
		width:100%;
		display:grid;
		grid-template-columns:48px 48px 1fr;
		gap:8px;
		align-items:center;
	}

	.erp-crew-audit-toolbar > .erp-row .erp-btn{
		width:48px;
		min-width:48px;
		padding-left:0;
		padding-right:0;
	}

	.erp-crew-audit-toolbar > .erp-btn{
		width:100%;
	}
}

/* ===== ZAŁOGI: kompaktowe karty mobilne ===== */
.erp-crew-status-inline{
	display:none;
}

.erp-crew-alert-wrap{
	display:inline-flex;
	align-items:center;
	gap:6px;
	vertical-align:middle;
}

.erp-crew-alert-label{
	display:none;
	font-size:11px;
	line-height:1;
	color:var(--muted2);
	font-weight:800;
}

.erp-crew-card-team{
	display:inline-flex;
	align-items:center;
	gap:8px;
	min-width:0;
}

@media (max-width: 720px){
	.erp-view[data-view="sedziowie_zalogi"] .erp-cardhead{
		padding:2.5vw !important;
	}

	.erp-view[data-view="sedziowie_zalogi"] .erp-cardtitle{
		font-size:16px;
		line-height:1.2;
	}

	.erp-view[data-view="sedziowie_zalogi"] .erp-cardhead .erp-muted{
		font-size:12px;
		line-height:1.3;
	}

	.erp-view[data-view="sedziowie_zalogi"] .erp-pad{
		padding:2.5vw !important;
	}

	.erp-view[data-view="sedziowie_zalogi"] .erp-formrow{
		padding:2vw 2.5vw 2.5vw !important;
		gap:2vw !important;
	}

	.erp-view[data-view="sedziowie_zalogi"] .erp-tablewrap{
		padding:0 2.5vw 2.5vw !important;
	}

	#erpCrewTable tbody{
		gap:2vw !important;
	}

	#erpCrewTable tbody tr[data-crew-id]{
		display:grid !important;
		grid-template-columns:repeat(2, minmax(0, 1fr));
		gap:0;
		padding:8px 10px !important;
		border-radius:14px !important;
		background:var(--panel2);
	}

	#erpCrewTable tbody tr[data-crew-id] td{
		display:block !important;
		min-width:0;
		padding:6px 6px !important;
		border:0 !important;
		border-top:0 !important;
		font-size:13px;
		line-height:1.25;
	}

	#erpCrewTable tbody tr[data-crew-id] td[data-label]::before{
		content:attr(data-label);
		display:block;
		margin-bottom:2px;
		font-size:10px;
		line-height:1.1;
		font-weight:900;
		letter-spacing:.04em;
		text-transform:uppercase;
		color:var(--muted2);
	}

	#erpCrewTable tbody tr[data-crew-id] td:nth-child(1),
	#erpCrewTable tbody tr[data-crew-id] td:nth-child(2),
	#erpCrewTable tbody tr[data-crew-id] td:nth-child(5){
		grid-column:1 / -1;
	}

	#erpCrewTable tbody tr[data-crew-id] td:nth-child(1),
	#erpCrewTable tbody tr[data-crew-id] td:nth-child(2),
	#erpCrewTable tbody tr[data-crew-id] td:nth-child(3),
	#erpCrewTable tbody tr[data-crew-id] td:nth-child(4){
		border-bottom:1px dashed var(--border) !important;
	}

	#erpCrewTable tbody tr[data-crew-id] td:nth-child(6){
		display:none !important;
	}

	#erpCrewTable .erp-crew-card-top{
		display:flex;
		align-items:center;
		justify-content:space-between;
		gap:10px;
	}

	#erpCrewTable .erp-crew-startno{
		font-size:16px;
		line-height:1.1;
		letter-spacing:.02em;
	}

	#erpCrewTable .erp-crew-status-inline{
		display:inline-flex;
		align-items:center;
		justify-content:flex-end;
		min-width:0;
	}

	#erpCrewTable .erp-crew-status-inline .erp-pill{
		font-size:10px;
		line-height:1;
		padding:5px 8px;
		white-space:nowrap;
	}

	#erpCrewTable .erp-crew-card-team{
		display:flex;
		align-items:center;
		gap:8px;
		min-width:0;
	}

	#erpCrewTable .erp-crew-card-team strong{
		min-width:0;
		overflow:hidden;
		text-overflow:ellipsis;
		white-space:nowrap;
		font-size:14px;
		line-height:1.2;
	}

	#erpCrewTable .erp-crew-alert-wrap{
		flex:0 0 auto;
		gap:5px;
	}

	#erpCrewTable .erp-crew-alert-label{
		display:inline;
	}

	#erpCrewTable .erp-crew-alert-badge{
		margin-left:0;
		min-width:20px;
		height:20px;
		font-size:11px;
	}

	#erpCrewTable tbody tr[data-crew-id] td:nth-child(3),
	#erpCrewTable tbody tr[data-crew-id] td:nth-child(4){
		font-size:13px;
	}

	#erpCrewTable tbody tr[data-crew-id] td:nth-child(5){
		font-size:13px;
		color:var(--text);
	}
}

@media (max-width: 380px){
	#erpCrewTable tbody tr[data-crew-id]{
		grid-template-columns:1fr;
	}

	#erpCrewTable tbody tr[data-crew-id] td:nth-child(3){
		border-bottom:1px dashed var(--border) !important;
	}

	#erpCrewTable tbody tr[data-crew-id] td:nth-child(4){
		border-bottom:1px dashed var(--border) !important;
	}
}

/* ===== UŻYTKOWNICY: kompaktowe karty mobilne ===== */
.erp-user-item{
	display:grid;
	grid-template-columns:minmax(210px, 280px) minmax(0, 1fr) minmax(150px, auto);
	gap:14px;
	align-items:center;
}

.erp-user-item > .erp-user-top,
.erp-user-item > .erp-user-grid,
.erp-user-item > .erp-user-actions{
	min-width:0;
}

.erp-user-top{
	display:flex;
	align-items:center;
	gap:10px;
	min-width:0;
}

.erp-user-login{
	display:flex;
	align-items:center;
	gap:8px;
	min-width:0;
}

.erp-user-status-dot{
	display:inline-block;
	width:10px;
	height:10px;
	border-radius:999px;
	border:1px solid rgba(17,24,39,0.18);
	flex:0 0 auto;
}

.erp-user-status-dot.is-active{ background:rgba(0,189,0,0.85); }
.erp-user-status-dot.is-disabled{ background:rgba(220,38,38,0.85); }

.erp-user-status{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	border-radius:999px;
	border:1px solid var(--border);
	padding:5px 10px;
	font-size:12px;
	font-weight:850;
	white-space:nowrap;
}

.erp-user-status.is-active{
	border-color:rgba(0,189,0,0.35);
	background:rgba(0,189,0,0.08);
	color:#15803d;
}

.erp-user-status.is-disabled{
	border-color:rgba(220,38,38,0.35);
	background:rgba(220,38,38,0.08);
	color:#b91c1c;
}

.erp-user-grid{
	display:grid;
	grid-template-columns:minmax(0, 1fr) minmax(0, 1.2fr) minmax(180px, 240px);
	gap:10px;
	align-items:center;
	min-width:0;
}

.erp-user-field{
	min-width:0;
}

.erp-user-label{
	display:block;
	margin-bottom:2px;
	font-size:10px;
	line-height:1.1;
	font-weight:900;
	letter-spacing:.04em;
	text-transform:uppercase;
	color:var(--muted2);
}

.erp-user-field strong,
.erp-user-field span:not(.erp-user-label):not(.erp-user-sep){
	display:inline-block;
	max-width:100%;
	overflow:hidden;
	text-overflow:ellipsis;
	white-space:nowrap;
}

.erp-user-sep{
	color:var(--muted2);
}

.erp-user-actions{
	display:flex;
	gap:8px;
	justify-content:flex-end;
	flex-wrap:wrap;
}

.erp-user-role-select{
	width:100%;
	max-width:100%;
}

.erp-user-task-field{
	grid-column:1 / -1;
}

.erp-user-task-row{
	display:grid;
	grid-template-columns:minmax(0, 1fr) auto;
	gap:8px;
	align-items:center;
}

.erp-user-task-input{
	width:100%;
	min-width:0;
	height:40px;
	border-radius:12px;
	border:1px solid var(--border);
	background:#ffffff;
	color:#111827;
	padding:0 10px;
	outline:none;
}

.erp-user-task-input:focus{
	border-color:rgba(0,189,0,0.45);
	box-shadow:0 0 0 3px rgba(0,189,0,0.10);
}

.erp-user-task-save{
	min-height:40px;
}

@media (max-width: 900px){
	.erp-user-item{
		grid-template-columns:1fr;
		gap:10px;
	}

	.erp-user-actions{
		justify-content:stretch;
	}

	.erp-user-actions .erp-btn{
		flex:1 1 0;
	}
}

@media (max-width: 720px){
	.erp-view[data-view="users_list"] .erp-cardhead{
		padding:2.5vw !important;
		gap:2vw !important;
	}

	.erp-view[data-view="users_list"] .erp-cardhead{
		flex-direction:column;
		align-items:stretch;
	}

	.erp-view[data-view="users_list"] .erp-cardtitle{
		font-size:16px;
		line-height:1.2;
	}

	.erp-view[data-view="users_list"] .erp-cardhead .erp-muted{
		font-size:12px;
		line-height:1.3;
	}

	.erp-view[data-view="users_list"] .erp-cardhead .erp-row{
		display:grid;
		grid-template-columns:1fr 1fr;
		gap:2vw;
		width:100%;
	}

	.erp-view[data-view="users_list"] .erp-cardhead .erp-btn{
		width:100%;
		min-width:0 !important;
	}

	.erp-view[data-view="users_list"] .erp-list{
		padding:2.5vw !important;
		gap:2vw !important;
	}

	.erp-view[data-view="users_list"] .erp-pad{
		padding:2.5vw !important;
	}

	.erp-user-item{
		padding:10px !important;
		border-radius:14px !important;
		gap:8px;
	}

	.erp-user-top{
		justify-content:space-between;
		gap:8px;
		padding-bottom:7px;
		border-bottom:1px dashed var(--border);
	}

	.erp-user-login{
		min-width:0;
	}

	.erp-user-status{
		font-size:10px;
		line-height:1;
		padding:5px 8px;
		flex:0 0 auto;
	}

	.erp-user-grid{
		grid-template-columns:1fr 1fr;
		gap:0;
	}

	.erp-user-field{
		padding:6px 6px;
		border-bottom:1px dashed var(--border);
	}

	.erp-user-field:nth-child(2),
	.erp-user-role-field{
		grid-column:1 / -1;
	}

	.erp-user-role-field{
		border-bottom:0;
	}

	.erp-user-label{
		font-size:10px;
		margin-bottom:3px;
	}

	.erp-user-field strong,
	.erp-user-field span:not(.erp-user-label):not(.erp-user-sep){
		font-size:13px;
		line-height:1.25;
	}

	.erp-user-role-select{
		width:100%;
		max-width:100%;
		min-height:42px;
		font-size:13px;
		padding:8px 10px;
	}

	.erp-user-task-row{
		grid-template-columns:1fr;
	}

	.erp-user-task-save{
		width:100%;
	}

	.erp-user-actions{
		display:grid;
		grid-template-columns:1fr 1fr;
		gap:8px;
		padding-top:2px;
	}

	.erp-user-actions .erp-btn{
		width:100%;
		min-width:0 !important;
	}
}

@media (max-width: 380px){
	.erp-view[data-view="users_list"] .erp-cardhead .erp-row,
	.erp-user-grid,
	.erp-user-actions{
		grid-template-columns:1fr;
	}

	.erp-user-field:nth-child(1){
		grid-column:1 / -1;
	}
}

/* ===== TELEFONY: szybki kontakt ===== */
.erp-phone-list{
	display:flex;
	flex-direction:column;
	gap:10px;
	padding:12px;
}

.erp-phone-item{
	display:grid;
	grid-template-columns:54px minmax(150px, 1fr) minmax(170px, .9fr) minmax(170px, auto);
	gap:12px;
	align-items:center;
}

.erp-phone-avatar{
	width:42px;
	height:42px;
	border-radius:14px;
	display:flex;
	align-items:center;
	justify-content:center;
	background:var(--accentSoft);
	border:1px solid rgba(0,189,0,0.25);
	font-weight:950;
	color:var(--text);
	justify-self:start;
}

.erp-phone-main,
.erp-phone-side,
.erp-phone-call{
	min-width:0;
}

.erp-phone-main{
	justify-self:stretch;
}

.erp-phone-name{
	display:block;
	font-size:16px;
	line-height:1.12;
	font-weight:950;
	max-width:100%;
}

.erp-phone-name-line{
	display:block;
	overflow:hidden;
	text-overflow:ellipsis;
	white-space:nowrap;
}

.erp-phone-side{
	justify-self:end;
	align-self:start;
	display:flex;
	flex-direction:column;
	align-items:flex-end;
	gap:5px;
	text-align:right;
	width:100%;
	max-width:260px;
}

.erp-phone-role{
	max-width:100%;
}

.erp-phone-task{
	max-width:260px;
	font-size:12px;
	font-weight:900;
	color:var(--text);
	white-space:normal;
	line-height:1.25;
}

.erp-phone-call{
	justify-self:end;
}

.erp-phone-link{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	min-height:40px;
	padding:0 14px;
	border-radius:14px;
	border:1px solid rgba(0,189,0,0.35);
	background:rgba(0,189,0,0.08);
	font-size:15px;
	font-weight:950;
	white-space:nowrap;
}

@media (max-width: 720px){
	.erp-view[data-view="phones"] .erp-cardhead{
		padding:2.5vw !important;
		gap:2vw !important;
		flex-direction:column;
		align-items:stretch;
	}

	.erp-view[data-view="phones"] .erp-cardhead .erp-row{
		display:grid;
		grid-template-columns:1fr;
		width:100%;
	}

	.erp-phone-list{
		padding:2.5vw !important;
		gap:2vw !important;
	}

	.erp-phone-item{
		grid-template-columns:42px minmax(0, 1fr) minmax(118px, auto);
		gap:10px;
		padding:10px !important;
		border-radius:14px !important;
		align-items:start;
	}

	.erp-phone-avatar{
		width:36px;
		height:36px;
		border-radius:13px;
		margin-top:2px;
	}

	.erp-phone-name{
		font-size:16px;
		line-height:1.12;
	}

	.erp-phone-side{
		align-items:flex-end;
		text-align:right;
		width:auto;
		max-width:180px;
	}

	.erp-phone-role{
		padding:3px 7px;
		font-size:9px;
	}

	.erp-phone-task{
		max-width:180px;
		font-size:12px;
	}

	.erp-phone-call{
		grid-column:1 / -1;
		justify-self:stretch;
	}

	.erp-phone-link{
		width:100%;
		min-height:44px;
	}
}

/* ===== DASHBOARD / PULPIT: mobilny panel operacyjny ===== */
.erp-dashboard-view{
	width:100%;
	max-width:var(--max);
	gap:clamp(8px, 2vw, 12px);
}

.erp-dashboard-hero{
	display:none !important;
}

.erp-dashboard-tiles{
	width:100%;
	margin:0 auto;
	display:grid;
	grid-template-columns:repeat(3, minmax(0, 1fr));
	gap:clamp(10px, 2vw, 16px);
}

.erp-dashboard-tiles .erp-tile{
	position:relative;
	width:100%;
	min-height:78px;
	padding:12px 42px 12px 12px;
	display:grid;
	grid-template-columns:46px minmax(0, 1fr);
	align-items:center;
	gap:12px;
	border-radius:18px;
	overflow:hidden;
	text-align:left;
}

.erp-dashboard-tiles .erp-tile::after{
	content:"›";
	position:absolute;
	right:14px;
	top:50%;
	transform:translateY(-50%);
	font-size:28px;
	line-height:1;
	font-weight:700;
	color:var(--muted2);
	opacity:.7;
}

.erp-dashboard-tiles .erp-tile:active{
	transform:scale(.99);
}

.erp-dashboard-tiles .erp-tile:focus-visible{
	outline:3px solid rgba(0,189,0,0.24);
	outline-offset:2px;
}

.erp-tile-icon{
	width:46px;
	height:46px;
	border-radius:14px;
	border:1px solid rgba(0,189,0,0.24);
	background:var(--accentSoft);
	color:#166534;
	display:flex;
	align-items:center;
	justify-content:center;
	flex:0 0 auto;
}

.erp-tile-icon svg{
	width:25px;
	height:25px;
	display:block;
	fill:none;
	stroke:currentColor;
	stroke-width:2;
	stroke-linecap:round;
	stroke-linejoin:round;
}

.erp-tile-icon svg *{
	vector-effect:non-scaling-stroke;
}

.erp-tile-body{
	min-width:0;
}

.erp-dashboard-tiles .erp-tile-title{
	font-size:17px;
	line-height:1.12;
	font-weight:950;
	letter-spacing:-.01em;
	color:var(--text);
	white-space:nowrap;
	overflow:hidden;
	text-overflow:ellipsis;
}

.erp-dashboard-tiles .erp-tile-meta{
	margin-top:3px;
	font-size:13px;
	line-height:1.22;
	color:var(--muted);
	display:-webkit-box;
	-webkit-line-clamp:2;
	-webkit-box-orient:vertical;
	overflow:hidden;
}

.erp-dashboard-tiles .erp-tile-install[hidden]{
	display:none !important;
}

/* Notatki organizacyjne na pulpicie */
.erp-btn-with-icon{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	gap:8px;
}

.erp-btn-with-icon svg{
	width:18px;
	height:18px;
	display:block;
	fill:none;
	stroke:currentColor;
	stroke-width:2;
	stroke-linecap:round;
	stroke-linejoin:round;
}

.erp-btn-dashboard-link{
	border-radius:999px;
	padding:0 16px;
	font-weight:850;
	box-shadow:0 2px 8px rgba(17,24,39,0.06);
}

.erp-dashboard-notes-card .erp-cardhead{
	flex-direction:row !important;
	align-items:center !important;
	gap:12px !important;
	padding:10px 12px !important;
}

.erp-dashboard-notes-card .erp-cardhead > div:first-child{
	min-width:0;
	flex:1 1 auto;
}

.erp-dashboard-notes-card .erp-cardhead .erp-row{
	width:auto;
	justify-content:flex-end;
	flex:0 0 auto;
}

.erp-dashboard-notes-card .erp-cardhead .erp-btn{
	min-width:0;
}

.erp-dashboard-notes-card .erp-list{
	padding:8px 10px 10px !important;
	gap:8px !important;
	min-height:0 !important;
}

.erp-dashboard-notes-card .erp-list > .erp-pad{
	min-height:0 !important;
	padding:9px 10px !important;
	border:1px solid var(--border);
	border-radius:var(--r);
	background:var(--panel2);
	line-height:1.3;
}

.erp-dashboard-notes-card .erp-item{
	align-items:flex-start !important;
	padding:9px 10px !important;
	min-height:0 !important;
}

.erp-dashboard-notes-card .erp-itemtop{
	align-items:flex-start !important;
}

@media (max-width: 979px){
	.erp-dashboard-notes-card .erp-cardhead{
		flex-direction:column !important;
		align-items:stretch !important;
		gap:8px !important;
		padding:10px !important;
	}

	.erp-dashboard-notes-card .erp-cardhead .erp-row{
		width:100%;
	}

	.erp-dashboard-notes-card .erp-cardhead .erp-btn{
		width:100%;
		min-width:0;
	}
}

/* Zdrowie systemu */
.erp-dashboard-health-card{
	margin-top:2px !important;
}

.erp-dashboard-health-head{
	flex-direction:row !important;
	align-items:center !important;
	gap:12px !important;
	padding:10px 12px !important;
}

.erp-dashboard-health-head > div:first-child{
	min-width:0;
	flex:1 1 auto;
}

.erp-dashboard-health-head .erp-cardtitle{
	font-size:17px;
	line-height:1.15;
}

.erp-dashboard-health-head .erp-muted{
	font-size:13px;
	line-height:1.3;
}

.erp-dashboard-health-actions{
	display:flex;
	flex:0 0 auto;
	gap:8px !important;
	align-items:center !important;
	width:auto;
}

.erp-dashboard-health-field{
	width:auto;
	min-width:0 !important;
	flex-direction:row !important;
	align-items:center;
	gap:8px;
}

.erp-dashboard-health-field span{
	white-space:nowrap;
}

.erp-dashboard-health-actions .erp-field{
	width:auto;
	min-width:0 !important;
}

.erp-dashboard-health-actions .erp-select{
	width:120px;
	min-width:120px !important;
	height:40px;
}

.erp-dashboard-health-actions .erp-btn{
	width:auto;
	min-width:112px !important;
	height:40px;
}

@media (min-width: 980px){
	.erp-dashboard-health-head > div:first-child .erp-muted{
		display:none;
	}
}

@media (max-width: 979px){
	.erp-dashboard-health-head{
		flex-direction:column !important;
		align-items:stretch !important;
		gap:8px !important;
		padding:10px !important;
	}

	.erp-dashboard-health-actions{
		display:grid;
		grid-template-columns:1fr !important;
		width:100%;
	}

	.erp-dashboard-health-field{
		width:100%;
		flex-direction:column !important;
		align-items:stretch;
	}

	.erp-dashboard-health-actions .erp-field,
	.erp-dashboard-health-actions .erp-select,
	.erp-dashboard-health-actions .erp-btn{
		width:100%;
		min-width:0 !important;
	}
}

.erp-health-summary{
	border:1px solid var(--border);
	border-radius:var(--r);
	background:var(--panel2);
	padding:10px 12px;
	margin-bottom:var(--gap);
	font-size:13px;
	font-weight:850;
	line-height:1.25;
}

.erp-health-summary.is-ok{
	border-color:rgba(22,101,52,0.22);
	background:rgba(22,101,52,0.08);
	color:#166534;
}

.erp-health-summary.is-warn,
.erp-health-summary.is-loading{
	border-color:rgba(180,83,9,0.22);
	background:rgba(180,83,9,0.08);
	color:#92400e;
}

.erp-health-summary.is-bad{
	border-color:rgba(185,28,28,0.22);
	background:rgba(185,28,28,0.08);
	color:#b91c1c;
}

.erp-health-item{
	position:relative;
	min-width:0;
	padding:11px 11px 11px 14px !important;
}

.erp-health-item::before{
	content:"";
	position:absolute;
	left:0;
	top:11px;
	bottom:11px;
	width:4px;
	border-radius:999px;
	background:var(--border);
}

.erp-health-item.is-ok::before{ background:#16a34a; }
.erp-health-item.is-warn::before{ background:#b45309; }
.erp-health-item.is-bad::before{ background:#b91c1c; }

.erp-health-label{
	font-size:12px !important;
	line-height:1.2;
	font-weight:850;
	color:var(--muted) !important;
	margin-bottom:4px !important;
}

.erp-health-value{
	font-size:clamp(20px, 5vw, 26px) !important;
	line-height:1.05 !important;
}

.erp-health-hint{
	margin-top:4px;
	font-size:11px;
	line-height:1.2;
	color:var(--muted2);
}

.erp-health-meta{
	display:flex;
	flex-wrap:wrap;
	gap:6px;
	margin-top:var(--gap) !important;
	font-size:12px;
	line-height:1.2;
}

.erp-health-meta span{
	display:inline-flex;
	align-items:center;
	border:1px solid var(--border);
	border-radius:999px;
	background:var(--panel2);
	padding:5px 8px;
}

/* Desktop */
@media (min-width: 980px){
	.erp-dashboard-view{
		width:min(1600px, 96vw) !important;
		max-width:none !important;
	}

	.erp-dashboard-tiles{
		grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
	}

	.erp-health-grid{
		grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
		gap:var(--gap) !important;
	}
}

/* Telefon / tablet pionowo: jedna kolumna, duże pola dotykowe */
@media (max-width: 979px){
	.erp-view[data-view="dashboard"]{
		width:100% !important;
		max-width:100% !important;
	}

	.erp-dashboard-tiles{
		grid-template-columns:1fr !important;
		width:100% !important;
		max-width:100% !important;
		gap:10px !important;
	}

	.erp-dashboard-tiles .erp-tile{
		min-height:84px !important;
		padding:14px 42px 14px 14px !important;
		grid-template-columns:50px minmax(0, 1fr);
		gap:12px;
		border-radius:18px;
	}

	.erp-dashboard-tiles .erp-tile::after{
		right:14px;
		font-size:26px;
	}

	.erp-tile-icon{
		width:50px;
		height:50px;
		border-radius:15px;
	}

	.erp-tile-icon svg{
		width:26px;
		height:26px;
	}

	.erp-dashboard-tiles .erp-tile-title{
		font-size:17px;
		line-height:1.12;
	}

	.erp-dashboard-tiles .erp-tile-meta{
		font-size:13px;
		line-height:1.2;
		-webkit-line-clamp:2;
	}

	.erp-dashboard-health-head{
		flex-direction:column;
		align-items:stretch !important;
		gap:8px;
		padding:10px !important;
	}

	.erp-dashboard-health-actions{
		grid-template-columns:1fr !important;
		width:100%;
		gap:8px;
	}

	.erp-dashboard-health-actions .erp-field,
	.erp-dashboard-health-actions .erp-select{
		width:100%;
		min-width:0 !important;
	}

	.erp-dashboard-health-actions .erp-btn{
		width:100%;
		min-width:0 !important;
	}

	.erp-dashboard-health-card .erp-pad{
		padding:10px !important;
	}

	.erp-health-grid{
		grid-template-columns:1fr !important;
		gap:8px !important;
	}

	.erp-health-summary{
		margin-bottom:8px;
		padding:9px 10px;
	}

	.erp-health-item{
		padding:10px 10px 10px 14px !important;
	}
}

/* Bardzo małe ekrany */
@media (max-width: 380px){
	.erp-dashboard-tiles .erp-tile{
		min-height:76px !important;
		padding:12px 36px 12px 12px !important;
		grid-template-columns:44px minmax(0, 1fr);
		gap:10px;
	}

	.erp-tile-icon{
		width:44px;
		height:44px;
		border-radius:13px;
	}

	.erp-tile-icon svg{
		width:23px;
		height:23px;
	}

	.erp-dashboard-tiles .erp-tile-title{
		font-size:16px;
	}

	.erp-dashboard-tiles .erp-tile-meta{
		font-size:12.5px;
	}

	.erp-dashboard-health-actions{
		grid-template-columns:1fr;
	}

	.erp-dashboard-health-actions .erp-btn{
		width:100%;
		min-width:0 !important;
	}
}

/* ===== ZGŁOSZENIA: czytelne karty mobilne ===== */
.erp-app-card-status{
	display:none;
}

.erp-app-label{
	display:block;
	margin-bottom:2px;
	font-size:10px;
	line-height:1.1;
	font-weight:900;
	letter-spacing:.04em;
	text-transform:uppercase;
	color:var(--muted2);
}

.erp-app-card-top{
	display:flex;
	align-items:flex-start;
	justify-content:space-between;
	gap:10px;
}

.erp-app-card-id{
	min-width:0;
}

.erp-app-card-id strong{
	display:block;
	min-width:0;
	overflow:hidden;
	text-overflow:ellipsis;
	white-space:nowrap;
}

.erp-app-card-sub{
	display:flex;
	flex-wrap:wrap;
	gap:6px 12px;
	margin-top:5px;
	font-size:12px;
	line-height:1.25;
	color:var(--muted);
}

.erp-app-card-team{
	display:grid;
	gap:5px;
}

.erp-app-field{
	min-width:0;
}

.erp-app-field strong,
.erp-app-field span:not(.erp-app-label):not(.erp-app-phone){
	overflow-wrap:anywhere;
}

.erp-app-phone{
	color:var(--muted);
}

.erp-app-paybox{
	display:grid;
	gap:6px;
}

.erp-app-field-paid strong{
	font-size:14px;
}

@media (max-width: 720px){
	.erp-view[data-view="applications"] .erp-cardhead{
		flex-direction:column;
		align-items:stretch !important;
		gap:10px;
		padding:10px !important;
	}

	.erp-view[data-view="applications"] .erp-cardtitle{
		font-size:17px;
		line-height:1.15;
	}

	.erp-view[data-view="applications"] .erp-cardhead .erp-muted{
		font-size:13px;
		line-height:1.3;
	}

	.erp-view[data-view="applications"] .erp-cardhead .erp-row{
		width:100%;
		display:grid;
		grid-template-columns:1fr;
		gap:8px;
	}

	.erp-view[data-view="applications"] .erp-cardhead .erp-btn{
		width:100%;
		min-width:0 !important;
	}

	.erp-view[data-view="applications"] .erp-tabs{
		display:grid;
		grid-template-columns:repeat(2, minmax(0, 1fr));
		gap:8px;
	}

	.erp-view[data-view="applications"] .erp-tab{
		width:100%;
		min-width:0;
		padding:10px 8px;
		font-size:13px;
		line-height:1.15;
		white-space:normal;
	}

	.erp-view[data-view="applications"] .erp-formrow{
		padding:10px !important;
		gap:8px !important;
	}

	.erp-view[data-view="applications"] .erp-tablewrap{
		padding:0 10px 10px !important;
	}

	#erpAppTable tbody{
		gap:10px !important;
	}

	#erpAppTable tbody tr[data-app-id]{
		display:grid !important;
		grid-template-columns:1fr;
		gap:0;
		padding:10px !important;
		border-radius:16px !important;
		background:var(--panel2);
		border:1px solid var(--border);
	}

	#erpAppTable tbody tr[data-app-id] td{
		display:block !important;
		padding:7px 6px !important;
		border:0 !important;
		min-width:0;
	}

	#erpAppTable tbody tr[data-app-id] td:nth-child(1),
	#erpAppTable tbody tr[data-app-id] td:nth-child(2){
		border-bottom:1px dashed var(--border) !important;
	}

	#erpAppTable .erp-app-card-top{
		align-items:center;
	}

	#erpAppTable .erp-app-card-id .erp-app-label{
		display:none;
	}

	#erpAppTable .erp-app-card-id strong{
		font-size:16px;
		line-height:1.15;
		letter-spacing:.01em;
	}

	#erpAppTable .erp-app-card-status{
		display:inline-flex;
		align-items:center;
		justify-content:flex-end;
		flex:0 0 auto;
	}

	#erpAppTable .erp-app-card-status .erp-pill{
		font-size:10px;
		line-height:1;
		padding:5px 8px;
		white-space:nowrap;
	}

	#erpAppTable .erp-app-card-sub{
		display:grid;
		grid-template-columns:1fr auto;
		gap:6px;
		margin-top:7px;
		font-size:12px;
		line-height:1.25;
	}

	#erpAppTable .erp-app-start-badge{
		font-size:12px;
		padding:4px 8px;
	}

	#erpAppTable .erp-app-card-team{
		gap:6px;
	}

	#erpAppTable .erp-app-field{
		padding:0;
	}

	#erpAppTable .erp-app-label{
		font-size:10px;
		margin-bottom:3px;
	}

	#erpAppTable .erp-app-field-team strong{
		display:block;
		font-size:15px;
		line-height:1.2;
	}

	#erpAppTable .erp-app-field span:not(.erp-app-label):not(.erp-app-phone){
		display:block;
		font-size:13px;
		line-height:1.25;
		color:var(--text);
	}

	#erpAppTable .erp-app-phone{
		font-size:12px;
		color:var(--muted);
	}

	#erpAppTable .erp-app-paybox{
		display:grid;
		grid-template-columns:1fr;
		gap:0;
	}

	#erpAppTable .erp-app-field-status{
		display:none;
	}

	#erpAppTable .erp-app-field-paid{
		display:flex;
		align-items:center;
		justify-content:space-between;
		gap:10px;
	}

	#erpAppTable .erp-app-field-paid .erp-app-label{
		margin:0;
	}

	#erpAppTable .erp-app-field-paid strong{
		font-size:14px;
		line-height:1.2;
		text-align:right;
	}
}

@media (max-width: 430px){
	.erp-view[data-view="applications"] .erp-formrow{
		grid-template-columns:1fr !important;
	}

	#erpAppTable .erp-app-card-sub{
		grid-template-columns:1fr;
	}

	#erpAppTable .erp-app-card-status .erp-pill{
		max-width:150px;
		overflow:hidden;
		text-overflow:ellipsis;
	}
}

@media (max-width: 380px){
	.erp-view[data-view="applications"] .erp-tabs{
		grid-template-columns:1fr;
	}

	#erpAppTable tbody tr[data-app-id]{
		padding:9px !important;
		border-radius:14px !important;
	}

	#erpAppTable .erp-app-card-id strong{
		font-size:15px;
	}

	#erpAppTable .erp-app-field-team strong{
		font-size:14px;
	}
}

/* ===== ZGŁOSZENIA DODATKOWE: responsywność ===== */
@media (max-width: 720px){
	.erp-view[data-view="additional_applications"] .erp-cardhead,
	.erp-view[data-view="additional_application_edit"] .erp-cardhead{
		flex-direction:column;
		align-items:stretch !important;
		gap:10px;
		padding:10px !important;
	}

	.erp-view[data-view="additional_applications"] .erp-cardtitle,
	.erp-view[data-view="additional_application_edit"] .erp-cardtitle{
		font-size:17px;
		line-height:1.15;
	}

	.erp-view[data-view="additional_applications"] .erp-cardhead .erp-muted,
	.erp-view[data-view="additional_application_edit"] .erp-cardhead .erp-muted{
		font-size:13px;
		line-height:1.3;
	}

	.erp-view[data-view="additional_applications"] .erp-cardhead .erp-row,
	.erp-view[data-view="additional_application_edit"] .erp-cardhead .erp-row,
	.erp-view[data-view="additional_application_edit"] .erp-app-actions{
		width:100%;
		display:grid;
		grid-template-columns:1fr;
		gap:8px;
	}

	.erp-view[data-view="additional_applications"] .erp-cardhead .erp-btn,
	.erp-view[data-view="additional_application_edit"] .erp-cardhead .erp-btn,
	.erp-view[data-view="additional_application_edit"] .erp-app-actions .erp-btn{
		width:100%;
		min-width:0 !important;
	}

	.erp-view[data-view="additional_applications"] .erp-formrow{
		grid-template-columns:1fr !important;
		padding:10px !important;
		gap:8px !important;
	}

	.erp-view[data-view="additional_applications"] .erp-tablewrap{
		padding:0 10px 10px !important;
	}

	#erpAdditionalTable tbody{
		gap:10px !important;
	}

	#erpAdditionalTable tbody tr[data-additional-id]{
		display:grid !important;
		grid-template-columns:1fr;
		gap:0;
		padding:10px !important;
		border-radius:16px !important;
		background:var(--panel2);
		border:1px solid var(--border);
	}

	#erpAdditionalTable tbody tr[data-additional-id] td{
		display:block !important;
		padding:7px 6px !important;
		border:0 !important;
		min-width:0;
	}

	#erpAdditionalTable tbody tr[data-additional-id] td + td{
		border-top:1px dashed var(--border) !important;
	}

	#erpAdditionalTable .erp-row{
		display:grid;
		grid-template-columns:1fr;
		gap:8px;
	}

	#erpAdditionalTable .erp-row .erp-btn{
		width:100%;
		min-width:0 !important;
	}

	#erpAdditionalTable .erp-app-field-team strong{
		display:block;
		font-size:15px;
		line-height:1.2;
	}

	#erpAdditionalTable .erp-app-field span:not(.erp-app-label):not(.erp-app-phone){
		display:block;
		font-size:13px;
		line-height:1.25;
		color:var(--text);
	}
}

@media (max-width: 380px){
	#erpAdditionalTable tbody tr[data-additional-id]{
		padding:9px !important;
		border-radius:14px !important;
	}

	#erpAdditionalTable .erp-app-field-team strong{
		font-size:14px;
	}
}

/* ===== ZAŁOGA + TRACKING: porządek mobile/desktop ===== */

.erp-crew-title-pill{
	margin-left:8px;
	vertical-align:middle;
}

.erp-crew-mobile-details{
	margin-top:12px;
	padding:0;
	border:1px solid var(--border);
	border-radius:18px;
	background:var(--panel2);
	overflow:hidden;
}

.erp-crew-mobile-details > summary{
	list-style:none;
	cursor:pointer;
	padding:14px 16px;
	font-weight:850;
	display:flex;
	align-items:center;
	justify-content:space-between;
	gap:12px;
}

.erp-crew-mobile-details > summary::-webkit-details-marker{
	display:none;
}

.erp-crew-mobile-details > summary::after{
	content:"▾";
	font-size:16px;
	line-height:1;
	color:var(--muted2);
	transition:transform .18s ease;
}

.erp-crew-mobile-details[open] > summary::after{
	transform:rotate(180deg);
}

.erp-crew-mobile-details-body{
	padding:0 14px 14px;
}

.erp-crew-actions-grid{
	display:grid;
	grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
	gap:10px;
	align-items:stretch;
}

.erp-crew-actions-grid .erp-btn{
	width:100%;
	justify-content:center;
}

.erp-crew-quickmeta{
	display:grid;
	grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
	gap:10px;
	margin:0 0 10px;
}

.erp-crew-quickmeta-item{
	border:1px solid var(--border);
	border-radius:14px;
	background:var(--panel);
	padding:10px 12px;
	display:flex;
	justify-content:space-between;
	gap:12px;
	align-items:center;
}

.erp-crew-quickmeta-item span{
	font-size:12px;
	color:var(--muted2);
	font-weight:700;
}

.erp-crew-quickmeta-item strong{
	font-size:15px;
}

.erp-crew-inline-head{
	justify-content:space-between;
	align-items:center;
	margin:0 0 10px;
}

.erp-crewtrack-head{
	align-items:flex-start;
	gap:12px;
}

.erp-crewtrack-head-main{
	min-width:0;
	flex:1 1 auto;
	display:flex;
	flex-direction:column;
	gap:4px;
}

.erp-crewtrack-titleline{
	display:flex;
	align-items:center;
	gap:8px;
	flex-wrap:wrap;
}

.erp-crewtrack-head-actions{
	display:grid;
	grid-template-columns:repeat(2, minmax(0, 1fr));
	gap:8px;
	width:min(420px, 100%);
}

.erp-crewtrack-head-actions .erp-btn{
	width:100%;
	min-width:0;
}

@media (min-width: 980px){
	.erp-crewtrack-head{
		display:grid;
		grid-template-columns:minmax(0, 1fr) minmax(320px, 420px);
		align-items:start;
	}
}

@media (max-width: 720px){
	.erp-crew-title-pill{
		margin-left:6px;
	}

	.erp-crew-mobile-details > summary{
		padding:12px 14px;
		font-size:14px;
	}

	.erp-crew-mobile-details-body{
		padding:0 10px 10px;
	}

	.erp-crew-actions-grid{
		grid-template-columns:1fr;
		gap:8px;
	}

	.erp-crewtrack-head{
		display:grid;
		grid-template-columns:1fr;
		align-items:stretch;
		gap:10px;
	}

	.erp-crewtrack-head-actions{
		width:100%;
		grid-template-columns:repeat(2, minmax(0, 1fr));
	}

	.erp-crewtrack-head-actions .erp-btn{
		font-size:12px;
		padding-left:8px;
		padding-right:8px;
	}

	.erp-crew-inline-head{
		flex-direction:column;
		align-items:flex-start !important;
		gap:8px;
	}
}

/* ===== korekta: status przy numerze załogi ===== */
.erp-view[data-view="crew"] .erp-cardhead .erp-cardtitle{
	display:flex;
	align-items:center;
	flex-wrap:wrap;
	gap:8px;
	line-height:1.25;
}

.erp-view[data-view="crew"] .erp-cardhead .erp-cardtitle .erp-crew-title-pill{
	margin-left:0;
	flex:0 0 auto;
}

@media (max-width: 720px){
	.erp-view[data-view="crew"] .erp-cardhead .erp-cardtitle{
		align-items:flex-start;
	}
}

/* ===== TRACKING ZAŁOGI: kompaktowy scanlog ===== */

.erp-crewtrack-scanlog-box > summary{
	gap:10px;
}

.erp-crewtrack-scanlog-count{
	margin-left:auto;
	border:1px solid var(--border);
	border-radius:999px;
	background:var(--panel);
	color:var(--muted2);
	padding:4px 9px;
	font-size:12px;
	font-weight:850;
	white-space:nowrap;
}

.erp-crewtrack-scanlog-meta{
	display:flex;
	flex-wrap:wrap;
	gap:6px;
	margin:0 0 10px;
	color:var(--muted2);
	font-size:12px;
	line-height:1.3;
}

.erp-crewtrack-scanlog-meta span{
	display:inline-flex;
	align-items:center;
	gap:5px;
	border:1px solid var(--border);
	border-radius:999px;
	background:var(--panel);
	padding:5px 8px;
	max-width:100%;
}

.erp-crewtrack-scanlog-meta b{
	color:var(--text);
	font-weight:850;
}

.erp-crewtrack-scanlog-list{
	display:flex;
	flex-direction:column;
	gap:8px;
}

.erp-crewtrack-scanlog-item{
	border:1px solid var(--border);
	border-radius:16px;
	background:var(--panel);
	padding:10px 12px;
	box-shadow:0 2px 8px rgba(17,24,39,.04);
}

.erp-crewtrack-scanlog-top{
	display:grid;
	grid-template-columns:auto minmax(0, 1fr) auto;
	align-items:center;
	gap:8px;
	padding-bottom:7px;
	border-bottom:1px dashed var(--border);
}

.erp-crewtrack-scanlog-no{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	min-width:38px;
	height:26px;
	border-radius:999px;
	background:var(--panel2);
	color:var(--muted2);
	font-size:12px;
	font-weight:900;
}

.erp-crewtrack-scanlog-time,
.erp-crewtrack-scanlog-type,
.erp-crewtrack-scanlog-code,
.erp-crewtrack-scanlog-dev{
	min-width:0;
}

.erp-crewtrack-scanlog-time span,
.erp-crewtrack-scanlog-type span,
.erp-crewtrack-scanlog-code span,
.erp-crewtrack-scanlog-dev span{
	display:block;
	margin-bottom:2px;
	color:var(--muted2);
	font-size:10px;
	font-weight:850;
	text-transform:uppercase;
	letter-spacing:.03em;
}

.erp-crewtrack-scanlog-time strong,
.erp-crewtrack-scanlog-type strong,
.erp-crewtrack-scanlog-code strong,
.erp-crewtrack-scanlog-dev strong{
	display:block;
	color:var(--text);
	font-size:13px;
	line-height:1.25;
	word-break:break-word;
}

.erp-crewtrack-scanlog-type strong{
	display:inline-flex;
	align-items:center;
	min-height:24px;
	border-radius:999px;
	background:rgba(37,99,235,.10);
	color:#1d4ed8;
	padding:3px 8px;
	font-weight:900;
}

.erp-crewtrack-scanlog-code,
.erp-crewtrack-scanlog-dev{
	display:grid;
	grid-template-columns:90px minmax(0, 1fr);
	gap:8px;
	align-items:start;
	padding-top:7px;
}

.erp-crewtrack-scanlog-code span,
.erp-crewtrack-scanlog-dev span{
	margin:2px 0 0;
}

.erp-crewtrack-scanlog-code strong,
.erp-crewtrack-scanlog-dev strong{
	word-break:break-all;
}

/* ===== WIDOK ZAŁOGI: Wyniki jako sekcja zwijana ===== */

.erp-crew-results-section > summary{
	font-size:15px;
}

.erp-crew-results-toolbar{
	gap:10px;
}

@media (max-width:720px){
	.erp-crewtrack-scanlog-top{
		grid-template-columns:auto minmax(0, 1fr);
	}

	.erp-crewtrack-scanlog-type{
		grid-column:2;
	}

	.erp-crewtrack-scanlog-code,
	.erp-crewtrack-scanlog-dev{
		grid-template-columns:72px minmax(0, 1fr);
	}

	.erp-crew-results-toolbar{
		flex-direction:column;
		align-items:stretch !important;
	}

	.erp-crew-results-toolbar > .erp-row{
		width:100%;
		display:grid;
		grid-template-columns:1fr 1fr;
		gap:8px;
	}

	.erp-crew-results-toolbar .erp-btn{
		width:100%;
		min-width:0;
	}
}

/* ===== NFC TOOLS: wspólny styl Emulator / Wizualizacja / GPS / Podgląd ===== */

.erp-nfc-tool-head{
	align-items:flex-start;
	gap:14px;
}

.erp-nfc-tool-titlebox{
	min-width:0;
	flex:1 1 auto;
	display:flex;
	flex-direction:column;
	gap:5px;
}

.erp-nfc-tool-statusrow{
	gap:8px;
	margin-top:4px;
}

.erp-status-chip{
	display:inline-flex;
	align-items:center;
	min-height:34px;
	border-radius:999px;
	border:1px solid var(--border);
	background:var(--panel2);
	color:var(--muted2);
	padding:0 11px;
	font-size:12px;
	font-weight:850;
	line-height:1.2;
}

.erp-status-chip:empty{
	display:none;
}

.erp-status-chip-warn:not(:empty){
	border-color:rgba(180,83,9,.35);
	background:var(--warnSoft);
	color:var(--warn);
}

.erp-nfc-tool-actions{
	display:flex;
	justify-content:flex-end;
	align-items:flex-end;
	gap:10px;
	flex-wrap:wrap;
	flex:0 0 auto;
	max-width:620px;
}

.erp-nfc-tool-actions .erp-field{
	min-width:240px;
}

.erp-nfc-tool-actions-compact{
	max-width:420px;
}

.erp-nfc-tool-actions .erp-btn{
	min-width:150px;
}

.erp-nfc-tool-help{
	margin-bottom:12px;
	padding:10px 12px;
	border:1px solid var(--border);
	border-radius:16px;
	background:var(--panel2);
	color:var(--muted2);
	font-size:13px;
	line-height:1.4;
}

.erp-view[data-view="sedziowie_qr_emulator"] .erp-card .erp-card,
.erp-view[data-view="sedziowie_nfc_wizualizacja"] .erp-card .erp-card,
.erp-view[data-view="sedziowie_nfc_gps_edit"] .erp-card .erp-card{
	width:100%;
	max-width:100%;
}

.erp-view[data-view="sedziowie_qr_emulator"] .erp-qr-grid{
	display:grid;
	grid-template-columns:minmax(260px, 420px) minmax(0, 1fr);
	gap:12px;
	align-items:stretch;
}

.erp-view[data-view="sedziowie_qr_emulator"] .erp-qr-img{
	width:min(360px, 100%);
	height:auto;
	max-width:100%;
}

.erp-view[data-view="sedziowie_qr_emulator"] .erp-qr-payloadtext{
	word-break:break-all;
	white-space:pre-wrap;
	line-height:1.35;
}

.erp-view[data-view="sedziowie_nfc_podglad_listy"] .erp-embed-frame-wrap{
	background:#f3f4f6;
}

@media (max-width:720px){
	html[data-erp-current-route="sedziowie_qr_emulator"] .erp-main,
	html[data-erp-current-route="sedziowie_nfc_wizualizacja"] .erp-main,
	html[data-erp-current-route="sedziowie_nfc_gps_edit"] .erp-main,
	html[data-erp-current-route="sedziowie_nfc_podglad_listy"] .erp-main{
		padding-left:1vw !important;
		padding-right:1vw !important;
	}

	html[data-erp-current-route="sedziowie_qr_emulator"] .erp-pagehead,
	html[data-erp-current-route="sedziowie_nfc_wizualizacja"] .erp-pagehead,
	html[data-erp-current-route="sedziowie_nfc_gps_edit"] .erp-pagehead,
	html[data-erp-current-route="sedziowie_nfc_podglad_listy"] .erp-pagehead{
		width:98vw !important;
		max-width:98vw !important;
		margin-left:auto !important;
		margin-right:auto !important;
	}

	.erp-view[data-view="sedziowie_qr_emulator"],
	.erp-view[data-view="sedziowie_nfc_wizualizacja"],
	.erp-view[data-view="sedziowie_nfc_gps_edit"],
	.erp-view[data-view="sedziowie_nfc_podglad_listy"]{
		width:98vw !important;
		max-width:98vw !important;
		margin-left:auto !important;
		margin-right:auto !important;
	}

	.erp-view[data-view="sedziowie_qr_emulator"] > .erp-card,
	.erp-view[data-view="sedziowie_nfc_wizualizacja"] > .erp-card,
	.erp-view[data-view="sedziowie_nfc_gps_edit"] > .erp-card,
	.erp-view[data-view="sedziowie_nfc_podglad_listy"] > .erp-card{
		width:100% !important;
		max-width:100% !important;
		border-radius:3vw;
	}

	.erp-nfc-tool-head{
		display:grid;
		grid-template-columns:1fr;
		align-items:stretch !important;
		gap:10px;
		padding:2.5vw !important;
	}

	.erp-nfc-tool-titlebox,
	.erp-nfc-tool-actions,
	.erp-nfc-tool-statusrow{
		width:100%;
		max-width:100%;
	}

	.erp-nfc-tool-statusrow{
		display:grid;
		grid-template-columns:1fr;
		gap:8px;
	}

	.erp-nfc-tool-actions{
		display:grid;
		grid-template-columns:1fr;
		gap:8px;
	}

	.erp-nfc-tool-actions .erp-field,
	.erp-nfc-tool-actions .erp-select,
	.erp-nfc-tool-actions .erp-btn,
	.erp-nfc-tool-statusrow .erp-btn{
		width:100%;
		min-width:0 !important;
		max-width:100% !important;
	}

	.erp-status-chip{
		width:100%;
		justify-content:center;
		text-align:center;
		border-radius:14px;
	}

	.erp-nfc-tool-help{
		margin-bottom:10px;
		padding:10px;
		font-size:12px;
		border-radius:14px;
	}

	.erp-view[data-view="sedziowie_qr_emulator"] .erp-pad,
	.erp-view[data-view="sedziowie_nfc_wizualizacja"] .erp-pad,
	.erp-view[data-view="sedziowie_nfc_gps_edit"] .erp-pad{
		padding:2.5vw !important;
	}

	.erp-view[data-view="sedziowie_qr_emulator"] .erp-qr-grid{
		grid-template-columns:1fr;
		gap:10px;
	}

	.erp-view[data-view="sedziowie_qr_emulator"] .erp-qr-box,
	.erp-view[data-view="sedziowie_qr_emulator"] .erp-qr-payload{
		min-width:0;
	}

	.erp-view[data-view="sedziowie_qr_emulator"] .erp-nfc-beta-grid{
		gap:10px;
	}

	.erp-view[data-view="sedziowie_qr_emulator"] .erp-nfc-beta-stage{
		border-radius:12px;
	}

	.erp-view[data-view="sedziowie_qr_emulator"] .erp-nfc-beta-stagehead{
		padding:10px;
	}

	.erp-view[data-view="sedziowie_qr_emulator"] .erp-nfc-beta-row{
		grid-template-columns:1fr;
		gap:8px;
		padding:10px;
	}

	.erp-view[data-view="sedziowie_qr_emulator"] .erp-nfc-beta-rowlabel{
		padding-top:0;
	}

	.erp-view[data-view="sedziowie_qr_emulator"] .erp-nfc-beta-pills{
		display:grid;
		grid-template-columns:repeat(2, minmax(0, 1fr));
		gap:8px;
	}

	.erp-view[data-view="sedziowie_qr_emulator"] .erp-nfc-beta-pill{
		width:100%;
		text-align:center;
		padding:9px 8px;
		white-space:normal;
		overflow-wrap:anywhere;
	}

	.erp-view[data-view="sedziowie_nfc_wizualizacja"] .erp-live-tagpanel{
		border-radius:14px;
	}

	.erp-view[data-view="sedziowie_nfc_wizualizacja"] .erp-live-classfilters{
		display:grid;
		grid-template-columns:repeat(2, minmax(0, 1fr));
		gap:8px;
	}

	.erp-view[data-view="sedziowie_nfc_wizualizacja"] .erp-checkpill{
		width:100%;
		justify-content:center;
	}

	.erp-view[data-view="sedziowie_nfc_gps_edit"] .erp-gpsedit-shell{
		display:grid;
		grid-template-columns:1fr;
		gap:10px;
	}

	.erp-view[data-view="sedziowie_nfc_gps_edit"] .erp-gpsedit-mapcol,
	.erp-view[data-view="sedziowie_nfc_gps_edit"] .erp-gpsedit-side{
		width:100%;
		min-width:0;
	}

	.erp-view[data-view="sedziowie_nfc_gps_edit"] .erp-gpsedit-actions{
		display:grid;
		grid-template-columns:1fr;
		gap:8px;
	}

	.erp-view[data-view="sedziowie_nfc_gps_edit"] .erp-gpsedit-actions .erp-btn{
		width:100%;
		min-width:0 !important;
	}

	.erp-view[data-view="sedziowie_nfc_podglad_listy"] .erp-embed-frame-wrap{
		height:calc(100vh - 230px);
		min-height:560px;
	}
}

@media (max-width:420px){
	.erp-view[data-view="sedziowie_qr_emulator"] .erp-nfc-beta-pills,
	.erp-view[data-view="sedziowie_nfc_wizualizacja"] .erp-live-classfilters{
		grid-template-columns:1fr;
	}

	.erp-view[data-view="sedziowie_nfc_podglad_listy"] .erp-embed-frame-wrap{
		height:calc(100vh - 215px);
		min-height:520px;
	}
}

/* ===== NFC: szybki podgląd listy tagów ===== */
.erp-nfc-preview-card .erp-cardhead{
	align-items:center;
}

.erp-nfc-preview-legend{
	margin-bottom:12px;
	line-height:1.45;
}

.erp-nfc-preview-lite-grid{
	gap:10px;
}

.erp-nfc-preview-lite-grid .erp-nfc-beta-stage{
	border-radius:14px;
}

.erp-nfc-preview-lite-grid .erp-nfc-beta-stagehead{
	padding:10px 12px;
	font-size:13px;
}

.erp-nfc-preview-lite-grid .erp-nfc-beta-row{
	grid-template-columns:120px 1fr;
	gap:8px;
	padding:9px 12px;
}

.erp-nfc-preview-lite-grid .erp-nfc-beta-rowlabel{
	padding-top:5px;
	font-size:11px;
}

.erp-nfc-preview-lite-grid .erp-nfc-beta-pills{
	gap:6px;
}

.erp-nfc-preview-pill{
	position:relative;
	min-width:92px;
	padding:7px 32px 7px 10px;
	cursor:default;
	text-align:left;
}

.erp-nfc-preview-pill:hover{
	transform:none;
	box-shadow:none;
}

.erp-nfc-preview-state{
	position:absolute;
	top:50%;
	right:8px;
	transform:translateY(-50%);
	font-size:10px;
	font-weight:950;
	opacity:.85;
}

.erp-nfc-preview-dot{
	display:inline-block;
	width:9px;
	height:9px;
	border-radius:999px;
	vertical-align:middle;
	margin-right:3px;
}

.erp-nfc-preview-dot.is-ok{ background:#22c55e; }
.erp-nfc-preview-dot.is-replaced{ background:#fb923c; }
.erp-nfc-preview-dot.is-empty{ background:#9ca3af; }

@media (max-width:720px){
	.erp-nfc-preview-card .erp-cardhead{
		flex-direction:column;
		align-items:stretch;
		gap:10px;
		padding:10px;
	}

	.erp-nfc-preview-actions,
	.erp-nfc-preview-actions .erp-field,
	.erp-nfc-preview-actions .erp-select,
	.erp-nfc-preview-actions .erp-btn{
		width:100%;
		min-width:0 !important;
	}

	.erp-nfc-preview-lite-grid .erp-nfc-beta-row{
		grid-template-columns:1fr;
		gap:6px;
		padding:8px;
	}

	.erp-nfc-preview-lite-grid .erp-nfc-beta-rowlabel{
		padding-top:0;
	}

	.erp-nfc-preview-lite-grid .erp-nfc-beta-pills{
		display:grid;
		grid-template-columns:repeat(2, minmax(0, 1fr));
		gap:6px;
	}

	.erp-nfc-preview-pill{
		width:100%;
		min-width:0;
		padding:8px 34px 8px 9px;
	}
}

/* ===== Ustawienia tras / GPX + przyciski warstw mapy ===== */
.erp-route-gpx-upload{
	align-items:flex-end;
}

.erp-route-gpx-status{
	display:inline-flex;
	align-items:center;
	gap:6px;
	padding:6px 10px;
	border-radius:999px;
	border:1px solid var(--border);
	font-size:12px;
	font-weight:900;
	white-space:nowrap;
}

.erp-route-gpx-status.is-loaded{
	border-color:rgba(34,197,94,.45);
	background:rgba(34,197,94,.12);
	color:#166534;
}

.erp-route-gpx-status.is-missing{
	border-color:rgba(107,114,128,.35);
	background:rgba(107,114,128,.10);
	color:var(--muted);
}

.erp-map-toggle{
	border-width:1px;
	transition:transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}

.erp-map-toggle:hover:not(:disabled){
	transform:translateY(-1px);
}

.erp-map-toggle.is-on{
	border-color:rgba(0,189,0,.55);
	background:var(--accentSoft);
	color:var(--accent);
	box-shadow:0 0 0 3px rgba(0,189,0,.10);
}

.erp-map-toggle.is-disabled,
.erp-map-toggle:disabled{
	opacity:.55;
	cursor:not-allowed;
	transform:none !important;
	box-shadow:none !important;
}

@media (max-width:720px){
	.erp-route-gpx-upload{
		align-items:stretch;
	}
}