/* 3task Post Order admin. System fonts only, no external requests. */
.threepo {
	--po-a: #064e3b;
	--po-b: #047857;
	--po-c: #4d7c0f;
	--po-acc: #047857;
	--po-acc-dark: #065f46;
	--po-acc-soft: #ecfdf5;
	--po-ink: #111827;
	--po-muted: #6b7280;
	--po-line: #e5e7eb;
	--po-card: #fff;
	--po-red: #b91c1c;
	--po-amber: #92400e;
	max-width: 1180px;
	color: var(--po-ink);
}
.threepo .threepo-icon { flex: none; vertical-align: -4px; }
.threepo [hidden] { display: none !important; }

/* Header */
.threepo-head {
	display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	margin: 16px 0 0; padding: 20px 24px; border-radius: 14px; color: #fff;
	background: linear-gradient(120deg, var(--po-a), var(--po-b) 55%, var(--po-c));
	box-shadow: 0 6px 20px rgba(4, 120, 87, .2);
}
.threepo-head-left { display: flex; align-items: center; gap: 14px; }
.threepo-head-icon {
	display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px;
	background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
}
.threepo-head-title { font-size: 21px; font-weight: 700; line-height: 1.2; }
.threepo-version { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .2); vertical-align: 3px; }
.threepo-head-sub { opacity: .92; margin-top: 3px; }
.threepo-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.threepo-head-pill {
	display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
	padding: 5px 10px; border-radius: 99px; background: rgba(0, 0, 0, .18);
}
.threepo-head-btn {
	display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px;
	color: #fff; text-decoration: none; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3);
}
.threepo-head-btn:hover, .threepo-head-btn:focus { color: #fff; background: rgba(255, 255, 255, .24); }
.threepo-head-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: none; }

/* Tabs */
.threepo-tabs { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; margin: 16px 0; border-bottom: 1px solid var(--po-line); }
.threepo .threepo-tab { white-space: nowrap; }
.threepo .threepo-tab {
	display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; margin-bottom: -1px;
	color: var(--po-muted); background: none; border: 0; border-bottom: 3px solid transparent;
	font: inherit; font-weight: 600; cursor: pointer; border-radius: 0;
}
.threepo .threepo-tab:hover { color: var(--po-acc); }
.threepo .threepo-tab.is-active { color: var(--po-acc); border-bottom-color: var(--po-acc); }

/* Cards */
.threepo .threepo-card { background: var(--po-card); border: 1px solid var(--po-line); border-radius: 12px; padding: 18px 22px; margin-bottom: 16px; }
.threepo .threepo-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 16px; }
.threepo .threepo-card.is-info { border-color: #a7f3d0; background: var(--po-acc-soft); }
.threepo .threepo-card.is-warning { border-color: #fcd34d; background: #fffbeb; }
.threepo .threepo-card.is-warning h2 { color: var(--po-amber); }
.threepo .threepo-subhead { margin: 18px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--po-muted); }
.threepo .threepo-hint { color: var(--po-muted); margin: 4px 0; }
.threepo .threepo-banner { padding: 10px 14px; border-radius: 8px; background: #fffbeb; border: 1px solid #fcd34d; color: var(--po-amber); }
.threepo .threepo-scope-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0 0; padding: 10px 14px; border-radius: 8px; background: #fffbeb; border: 1px solid #fcd34d; color: #1f2937; }
.threepo .threepo-scope-note[hidden] { display: none; }
.threepo .threepo-scope-note[data-applies="true"] { background: #ecfdf5; border-color: #a7f3d0; }
.threepo .threepo-scope-note .threepo-icon { flex: none; color: var(--po-amber); }
.threepo .threepo-scope-note[data-applies="true"] .threepo-icon { color: var(--po-acc-dark); }
.threepo .threepo-scope-note span { flex: 1 1 240px; }
.threepo .threepo-scope-note a { font-weight: 600; color: var(--po-acc-dark); }
.threepo .threepo-error { color: var(--po-red); font-weight: 600; margin: 8px 0; }
.threepo .threepo-error:empty { display: none; }

/* Buttons */
.threepo .button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; border-radius: 8px; }
.threepo .button:not(.button-primary):not(.threepo-danger) { color: var(--po-acc-dark); border-color: #a7c4b8; background: #fff; }
.threepo .button:not(.button-primary):not(.threepo-danger):hover { background: var(--po-acc-soft); border-color: var(--po-acc); }
.threepo .button-primary { background: var(--po-acc); border-color: var(--po-acc); }
.threepo .button-primary:hover, .threepo .button-primary:focus { background: var(--po-acc-dark); border-color: var(--po-acc-dark); }
.threepo .button.threepo-danger { color: var(--po-red); border-color: #fca5a5; background: #fff; }
.threepo .button.threepo-danger:hover { background: #fef2f2; border-color: var(--po-red); }
.threepo .button:disabled { opacity: .55; }
.threepo button:focus-visible, .threepo a:focus-visible, .threepo input:focus-visible, .threepo select:focus-visible {
	outline: 3px solid var(--po-acc); outline-offset: 2px; box-shadow: none;
}

/* Order chooser and scope */
.threepo-choose-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.threepo-choose-row .threepo-field { margin: 0; flex: 1 1 320px; }
.threepo-choose-row select { width: 100%; max-width: 520px; min-height: 40px; font-size: 15px; font-weight: 600; }
.threepo-choose-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.threepo-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 0; }
.threepo-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--po-acc-soft); color: var(--po-acc-dark); }
.threepo-pill.is-quiet { background: #f3f4f6; color: #374151; }
.threepo-scopes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.threepo .threepo-scope {
	display: flex; align-items: flex-start; gap: 10px; text-align: left; padding: 12px 14px;
	background: #fff; border: 1px solid var(--po-line); border-left: 4px solid var(--po-line); border-radius: 10px;
	color: var(--po-ink); font: inherit; cursor: pointer;
}
.threepo .threepo-scope .threepo-icon { color: var(--po-muted); margin-top: 1px; }
.threepo .threepo-scope strong { display: block; margin-bottom: 2px; }
.threepo .threepo-scope span span { color: var(--po-muted); font-size: 13px; }
.threepo .threepo-scope:hover:not(:disabled) { border-color: var(--po-acc); }
.threepo .threepo-scope.is-active { border-color: #a7f3d0; border-left-color: var(--po-acc); background: var(--po-acc-soft); }
.threepo .threepo-scope.is-active .threepo-icon { color: var(--po-acc); }
.threepo .threepo-scope:disabled { cursor: default; }
.threepo .threepo-scope:disabled:not(.is-active) { opacity: .6; }

/* List */
.threepo-listhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.threepo-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.threepo .threepo-status {
	display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 22px; padding: 9px 14px; margin: 0 0 12px;
	border-radius: 8px; background: #f3f4f6; color: #374151;
}
.threepo .threepo-status[data-state="saved"] { background: var(--po-acc-soft); color: var(--po-acc-dark); }
.threepo .threepo-status[data-state="error"] { background: #fef2f2; color: var(--po-red); }
.threepo .threepo-status[data-state="saving"] .threepo-icon { animation: threepo-spin 1s linear infinite; }
.threepo .threepo-status > span { flex: 1 1 12rem; min-width: 0; }
.threepo .threepo-status .button { margin-left: auto; }
@keyframes threepo-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.threepo .threepo-status[data-state="saving"] .threepo-icon { animation: none; }
}

.threepo-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--po-line); border-radius: 10px; overflow: hidden; }
.threepo-row {
	position: relative; display: grid; grid-template-columns: auto 34px minmax(0, 1fr) auto; align-items: center; gap: 12px;
	margin: 0; padding: 10px 14px 10px 10px; background: #fff; border-bottom: 1px solid var(--po-line);
}
.threepo-row:last-child { border-bottom: 0; }
.threepo-row:hover { background: #f9fafb; }
.threepo-row:focus-within { background: var(--po-acc-soft); }
.threepo-row.is-marked { box-shadow: inset 4px 0 0 var(--po-acc); }
.threepo-row.is-dragging { opacity: .55; }
.threepo-row[data-drop="before"]::before, .threepo-row[data-drop="after"]::after {
	content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--po-acc); z-index: 1;
}
.threepo-row[data-drop="before"]::before { top: -2px; }
.threepo-row[data-drop="after"]::after { bottom: -2px; }
.threepo .threepo-handle {
	display: grid; place-items: center; width: 36px; height: 40px; padding: 0; border-radius: 8px;
	color: var(--po-muted); background: transparent; border: 1px solid transparent; cursor: grab; touch-action: none;
}
.threepo .threepo-handle:hover:not(:disabled) { color: var(--po-acc); background: #fff; border-color: var(--po-line); }
.threepo .threepo-handle:active { cursor: grabbing; }
.threepo .threepo-handle:disabled { cursor: not-allowed; opacity: .4; }
.threepo-pos {
	display: grid; place-items: center; width: 30px; height: 30px; border-radius: 99px;
	background: #f3f4f6; color: #374151; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.threepo-title-wrap { min-width: 0; }
.threepo-title { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.threepo-id { display: block; color: var(--po-muted); font-size: 12px; }
.threepo-actions { display: flex; align-items: center; gap: 6px; }
.threepo .threepo-iconbtn { width: 36px; justify-content: center; padding: 0; }
.threepo-edit { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--po-muted); }
.threepo-edit:hover { color: var(--po-acc); background: var(--po-acc-soft); }
.threepo-none { padding: 18px; color: var(--po-muted); }
.threepo-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.threepo .threepo-next { flex-direction: row-reverse; }
.threepo-page { color: var(--po-muted); font-weight: 600; }

/* Empty state */
.threepo .threepo-empty { text-align: center; padding: 40px 22px; }
.threepo .threepo-empty h2 { justify-content: center; font-size: 18px; }
.threepo .threepo-empty p { max-width: 520px; margin: 6px auto; }
.threepo-empty-icon {
	display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 10px; border-radius: 16px;
	color: #fff; background: linear-gradient(120deg, var(--po-a), var(--po-b) 55%, var(--po-c));
}
.threepo-empty-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Fields and dialogs */
.threepo .threepo-field { display: block; margin: 14px 0; }
.threepo .threepo-field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.threepo .threepo-field input, .threepo .threepo-field select { width: 100%; max-width: 520px; min-height: 36px; }
.threepo .threepo-field .threepo-hint { display: block; font-size: 12px; }
.threepo .threepo-check { display: flex; gap: 10px; align-items: flex-start; }
.threepo .threepo-check input { margin-top: 2px; }
.threepo-dialog {
	width: min(580px, 92vw); max-height: 85vh; padding: 0; overflow: auto;
	border: 0; border-radius: 14px; box-shadow: 0 24px 48px rgba(0, 0, 0, .25); color: var(--po-ink);
}
.threepo-dialog::backdrop { background: rgba(17, 24, 39, .55); }
.threepo-dialog-head {
	position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 14px 18px; color: #fff; background: linear-gradient(120deg, var(--po-a), var(--po-b) 55%, var(--po-c));
}
.threepo-dialog-head h2 { margin: 0; font-size: 16px; color: #fff; overflow-wrap: anywhere; }
.threepo .threepo-dialog-x {
	display: grid; place-items: center; width: 34px; height: 34px; padding: 0; flex: none; border-radius: 8px;
	color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); cursor: pointer;
}
.threepo .threepo-dialog-x .threepo-icon { transform: rotate(45deg); }
.threepo-dialog-body { padding: 6px 20px 20px; }
.threepo-dialog-body > .button { margin: 10px 8px 0 0; }
.threepo-dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.threepo-results { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.threepo .threepo-result {
	text-align: left; white-space: normal; min-height: 40px; padding: 8px 12px; border-radius: 8px;
	background: #fff; border: 1px solid var(--po-line); cursor: pointer; font: inherit; color: var(--po-ink);
}
.threepo .threepo-result:hover { border-color: var(--po-acc); background: var(--po-acc-soft); }

/* Import */
.threepo-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 12px 0; }
.threepo-group { border: 1px solid var(--po-line); border-left: 4px solid var(--po-acc); border-radius: 10px; padding: 12px 14px; }
.threepo-group h3 { margin: 0 0 4px; font-size: 14px; }
.threepo-group ol { margin: 8px 0 0 18px; color: #374151; }
.threepo-links { margin: 8px 0 0 18px; list-style: disc; }
.threepo-resume { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 18px; }

@media (max-width: 960px) {
	.threepo-scopes { grid-template-columns: 1fr; }
}
@media (max-width: 782px) {
	.threepo-head { padding: 16px; }
	.threepo-row { grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; }
	.threepo-pos { display: none; }
	.threepo-actions { grid-column: 2; flex-wrap: wrap; }
	.threepo .button { min-height: 40px; }
	.threepo-listhead { flex-direction: column; }
}
