/**
 * Deljeni stilovi za komponente porudžbine (faze izrade + delovi).
 * Namerno koriste providne neutralne boje i currentColor, da izgledaju dobro
 * i na svetlom wp-admin ekranu i na tamnom front-end portalu, bez posebnih tema.
 */

/* ============================================================ FAZE IZRADE */
.pc-stages { margin: 2px 0 4px; }

.pc-stages-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 8px;
}
.pc-stages-title { font-weight: 700; font-size: 14px; }
.pc-stages-pct {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	font-size: 13px;
	opacity: .8;
}
.pc-stages.is-complete .pc-stages-pct { color: #16a34a; opacity: 1; }

.pc-stages-overall {
	height: 12px;
	border-radius: 8px;
	background: rgba(125,125,125,.16);
	overflow: hidden;
	margin-bottom: 18px;
}
.pc-stages-overall-fill {
	height: 100%;
	width: 0;
	border-radius: 8px;
	background: linear-gradient(90deg, #f5c518, #22c55e);
	transition: width .45s cubic-bezier(.4,0,.2,1);
}
.pc-stages.is-complete .pc-stages-overall-fill {
	background: linear-gradient(90deg, #16a34a, #22c55e);
}

.pc-stages-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.pc-stage {
	display: grid;
	grid-template-columns: 210px 1fr 104px;
	align-items: center;
	gap: 14px;
	padding: 9px 10px;
	border-radius: 8px;
	transition: background .15s ease;
}
.pc-stage:hover { background: rgba(125,125,125,.07); }

/* Custom checkbox */
.pc-stage-check {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	margin: 0;
	font-weight: 500;
	user-select: none;
	position: relative;
}
.pc-stage-check input { position: absolute; left: 0; top: 0; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.pc-stage-box {
	display: inline-block;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 6px;
	border: 2px solid rgba(140,140,140,.6);
	background: rgba(125,125,125,.08);
	position: relative;
	transition: all .18s ease;
	box-sizing: border-box;
}
.pc-stage-box::after {
	content: '';
	position: absolute;
	left: 6px;
	top: 2px;
	width: 6px;
	height: 11px;
	border: solid #fff;
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg) scale(0);
	transition: transform .18s cubic-bezier(.5,1.6,.4,1);
}
.pc-stage-check input:focus-visible + .pc-stage-box {
	outline: 2px solid #22c55e;
	outline-offset: 2px;
}
.pc-stage.is-done .pc-stage-box {
	background: #16a34a;
	border-color: #16a34a;
}
.pc-stage.is-done .pc-stage-box::after { transform: rotate(45deg) scale(1); }
.pc-stage-label { line-height: 1.2; }
.pc-stage.is-done .pc-stage-label { font-weight: 600; }

/* Per-stage track */
.pc-stage-track {
	height: 8px;
	border-radius: 6px;
	background: rgba(125,125,125,.16);
	overflow: hidden;
}
.pc-stage-fill {
	height: 100%;
	width: 0;
	border-radius: 6px;
	background: linear-gradient(90deg, #16a34a, #22c55e);
	transition: width .4s cubic-bezier(.4,0,.2,1);
}
.pc-stage.is-done .pc-stage-fill { width: 100%; }

/* Status pill */
.pc-stage-status {
	justify-self: end;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 20px;
	background: rgba(125,125,125,.14);
	opacity: .75;
	white-space: nowrap;
}
.pc-stage.is-done .pc-stage-status {
	background: rgba(34,197,94,.16);
	color: #16a34a;
	opacity: 1;
}
.pc-stage-status .dot {
	width: 6px; height: 6px; border-radius: 50%;
	background: currentColor; display: inline-block;
}

@media ( max-width: 782px ) {
	.pc-stage { grid-template-columns: 1fr auto; gap: 8px 12px; }
	.pc-stage-track { grid-column: 1 / -1; order: 3; }
}

/* ================================================================ DELOVI */
.pc-parts-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 16px;
}
.pc-parts-table th,
.pc-parts-table td {
	padding: 9px 12px;
	text-align: left;
	border-bottom: 1px solid rgba(125,125,125,.22);
	font-size: 13px;
}
.pc-parts-table th {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .04em;
	opacity: .6;
	font-weight: 700;
}
.pc-parts-table tbody tr:hover { background: rgba(125,125,125,.06); }
.pc-parts-table .pc-parts-empty td { opacity: .6; font-style: italic; }
.pc-part-remove {
	color: #c0392b;
	cursor: pointer;
	background: none;
	border: 0;
	padding: 0;
	font-size: 12px;
	font-weight: 600;
}
.pc-part-remove:hover { text-decoration: underline; }

.pc-part-add {
	display: flex;
	gap: 8px;
	position: relative;
	max-width: 520px;
	align-items: stretch;
}
.pc-part-search { flex: 1; }
.pc-part-qty { width: 72px; flex: 0 0 auto; }

.pc-part-suggestions {
	display: none;
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	background: #fff;
	color: #1d2327;
	border: 1px solid rgba(125,125,125,.35);
	border-radius: 8px;
	box-shadow: 0 8px 28px rgba(0,0,0,.18);
	z-index: 50;
	max-height: 280px;
	overflow: auto;
}
.pc-part-sugg {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 9px 12px;
	cursor: pointer;
	border-bottom: 1px solid rgba(125,125,125,.15);
}
.pc-part-sugg:last-child { border-bottom: 0; }
.pc-part-sugg.active,
.pc-part-sugg:hover { background: rgba(245,197,24,.16); }
.pc-part-sugg .sifra { font-weight: 700; font-variant-numeric: tabular-nums; }
.pc-part-sugg .naziv { flex: 1; }
.pc-part-state {
	padding: 12px;
	font-size: 13px;
	text-align: center;
	opacity: .7;
}
.pc-part-state.error { color: #c0392b; opacity: 1; }
.pc-part-spinner {
	display: inline-block;
	width: 14px; height: 14px;
	border: 2px solid rgba(125,125,125,.35);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: pc-spin .7s linear infinite;
	vertical-align: -2px;
	margin-right: 6px;
}
@keyframes pc-spin { to { transform: rotate(360deg); } }
