/* ───────────────────────────────────────────────────
   Activity / Run History  –  ac- namespace
   ─────────────────────────────────────────────────── */

/* ── Shared card (reuses dashboard shadow) ──────── */
.ac-card {
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	box-shadow:
		0 0.46875rem 2.1875rem rgba(4,9,20,.03),
		0 0.9375rem 1.40625rem rgba(4,9,20,.03),
		0 0.25rem 0.53125rem rgba(4,9,20,.05),
		0 0.125rem 0.1875rem rgba(4,9,20,.03);
	margin-bottom: 0.75rem;
}

.ac-card-body {
	padding: 1.25rem;
}

/* ── Section title ──────────────────────────────── */
.ac-section-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.92rem;
	font-weight: 700;
	color: #1f2937;
	margin-bottom: 0.25rem;
}

.ac-section-title i {
	color: var(--a);
	font-size: 0.85rem;
}

.ac-section-desc {
	font-size: 0.78rem;
	color: #6b7280;
	margin-bottom: 0;
}

/* ── Run list ───────────────────────────────────── */
.ac-run-list {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ac-run {
	display: grid;
	grid-template-columns: 48px 1fr auto;
	align-items: center;
	gap: 1rem;
	padding: 0.85rem 0;
	border-bottom: 1px solid #f3f4f6;
	text-decoration: none;
	color: inherit;
	transition: background .15s ease;
	border-radius: 6px;
	margin: 0 -0.5rem;
	padding-left: 0.5rem;
	padding-right: 0.5rem;
}

.ac-run:last-child {
	border-bottom: none;
}

.ac-run:hover {
	background: #f9fafb;
}

/* Run number circle */
.ac-run-num {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--a) 0%, #e07e00 100%);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.78rem;
	font-weight: 700;
	flex-shrink: 0;
}

/* Run info (date + stats row) */
.ac-run-info {
	min-width: 0;
}

.ac-run-date {
	font-size: 0.82rem;
	font-weight: 600;
	color: #1f2937;
	margin-bottom: 0.2rem;
}

.ac-run-date small {
	font-weight: 400;
	color: #9ca3af;
	margin-left: 0.3rem;
}

.ac-run-stats {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.ac-run-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.7rem;
	font-weight: 600;
	padding: 0.15rem 0.5rem;
	border-radius: 20px;
	line-height: 1.5;
}

.ac-run-chip i {
	font-size: 0.6rem;
}

.ac-chip--total    { background: #f3f4f6; color: #4b5563; }
.ac-chip--rec      { background: #ecfdf5; color: #059669; }
.ac-chip--rej      { background: #fef2f2; color: #dc2626; }
.ac-chip--filt     { background: #fffbeb; color: #d97706; }
.ac-chip--withdraw { background: #eff6ff; color: #2563eb; }

/* Arrow / chevron */
.ac-run-arrow {
	color: #d1d5db;
	font-size: 0.85rem;
	transition: color .15s ease, transform .15s ease;
	flex-shrink: 0;
}

.ac-run:hover .ac-run-arrow {
	color: var(--a);
	transform: translateX(2px);
}

/* ── Stat cards (detail page) ───────────────────── */
.ac-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.ac-stat {
	position: relative;
	background: #fff;
	border-radius: 10px;
	padding: 1rem 1rem 0.85rem;
	overflow: hidden;
	box-shadow:
		0 0.46875rem 2.1875rem rgba(4,9,20,.03),
		0 0.9375rem 1.40625rem rgba(4,9,20,.03),
		0 0.25rem 0.53125rem rgba(4,9,20,.05),
		0 0.125rem 0.1875rem rgba(4,9,20,.03);
	text-align: center;
	transition: transform .18s ease, box-shadow .18s ease;
}

.ac-stat:hover {
	transform: translateY(-2px);
	box-shadow:
		0 0.6rem 2.4rem rgba(4,9,20,.06),
		0 1rem 1.6rem rgba(4,9,20,.05),
		0 0.3rem 0.7rem rgba(4,9,20,.08),
		0 0.15rem 0.25rem rgba(4,9,20,.04);
}

.ac-stat::before {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: var(--ac-accent, #f79319);
}

.ac-stat-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	font-size: 0.9rem;
	color: #fff;
	background: var(--ac-accent, #f79319);
	margin: 0 auto 0.5rem;
}

.ac-stat-value {
	font-size: 1.6rem;
	font-weight: 700;
	color: #1f2937;
	line-height: 1.15;
}

.ac-stat-label {
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b7280;
	margin-top: 0.1rem;
}

.ac-stat--analyzed  { --ac-accent: #6b7280; }
.ac-stat--rec       { --ac-accent: #059669; }
.ac-stat--rej       { --ac-accent: #dc2626; }
.ac-stat--filt      { --ac-accent: #d97706; }

/* ── Strategy insights alert ────────────────────── */
.ac-insights {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 8px;
	padding: 0.85rem 1rem;
	margin-bottom: 0.75rem;
}

.ac-insights-title {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.8rem;
	font-weight: 700;
	color: #92400e;
	margin-bottom: 0.35rem;
}

.ac-insights-title i {
	color: #f59e0b;
}

.ac-insights ul {
	margin: 0;
	padding-left: 1.25rem;
	font-size: 0.78rem;
	color: #78350f;
}

.ac-insights li:not(:last-child) {
	margin-bottom: 0.15rem;
}

/* ── Outcome group header ───────────────────────── */
.ac-group-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.85rem;
}

.ac-group-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	border-radius: 6px;
	font-size: 0.72rem;
	font-weight: 700;
	color: #fff;
	padding: 0 0.4rem;
}

.ac-group-count--rec      { background: #059669; }
.ac-group-count--rej      { background: #dc2626; }
.ac-group-count--filt     { background: #d97706; }
.ac-group-count--withdraw { background: #2563eb; }

.ac-group-label {
	font-size: 0.9rem;
	font-weight: 700;
	color: #1f2937;
}

/* ── Decision card ──────────────────────────────── */
.ac-decision {
	background: #fff;
	border-radius: 10px;
	border: 1px solid #f3f4f6;
	overflow: hidden;
	transition: box-shadow .2s ease, transform .2s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.ac-decision:hover {
	box-shadow:
		0 0.5rem 2.5rem rgba(4,9,20,.06),
		0 1rem 1.5rem rgba(4,9,20,.05),
		0 0.3rem 0.6rem rgba(4,9,20,.07);
	transform: translateY(-2px);
}

.ac-decision-accent {
	height: 3px;
	background: var(--ac-decision-color, #6b7280);
}

.ac-decision-accent--rec      { --ac-decision-color: #059669; }
.ac-decision-accent--rej      { --ac-decision-color: #dc2626; }
.ac-decision-accent--filt     { --ac-decision-color: #d97706; }
.ac-decision-accent--withdraw { --ac-decision-color: #2563eb; }

.ac-decision-body {
	padding: 0.9rem 1rem;
	display: flex;
	flex-direction: column;
	flex: 1;
}

/* Decision header */
.ac-decision-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 0.5rem;
	margin-bottom: 0.6rem;
}

.ac-decision-address {
	font-size: 0.85rem;
	font-weight: 600;
	color: #1f2937;
	line-height: 1.3;
}

.ac-decision-city {
	font-size: 0.68rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #9ca3af;
}

.ac-decision-badges {
	display: flex;
	gap: 0.3rem;
	flex-shrink: 0;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.ac-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.18rem 0.55rem;
	border-radius: 20px;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	white-space: nowrap;
}

.ac-badge--rec      { background: #ecfdf5; color: #059669; }
.ac-badge--rej      { background: #fef2f2; color: #dc2626; }
.ac-badge--filt     { background: #fffbeb; color: #d97706; }
.ac-badge--withdraw { background: #eff6ff; color: #2563eb; }

.ac-badge--high   { background: #fef2f2; color: #dc2626; }
.ac-badge--medium { background: #fffbeb; color: #d97706; }
.ac-badge--low    { background: #f3f4f6; color: #6b7280; }

/* Decision metrics grid */
.ac-decision-metrics {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0;
	margin-bottom: 0.6rem;
	background: #f9fafb;
	border-radius: 6px;
	padding: 0.5rem 0.65rem;
}

.ac-metric {
	text-align: center;
	padding: 0.15rem 0;
}

.ac-metric-label {
	font-size: 0.62rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #9ca3af;
	margin-bottom: 0.1rem;
}

.ac-metric-value {
	font-size: 0.82rem;
	font-weight: 700;
	color: #374151;
}

.ac-metric-value--price {
	color: var(--a);
}

/* Tags row */
.ac-decision-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	margin-bottom: 0.5rem;
}

.ac-tag {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.15rem 0.5rem;
	border-radius: 4px;
	font-size: 0.65rem;
	font-weight: 600;
	background: #f3f4f6;
	color: #6b7280;
}

.ac-tag--type-reg  { background: #fff7ed; color: #c2410c; }
.ac-tag--type-lot  { background: #fef3c7; color: #b45309; }
.ac-tag--category  { background: #f3f4f6; color: #6b7280; }
.ac-tag--conf      { background: #eff6ff; color: #2563eb; }

/* Reasoning list */
.ac-reasons {
	margin: 0;
	padding: 0;
	list-style: none;
	flex: 1;
}

.ac-reasons li {
	display: flex;
	align-items: flex-start;
	gap: 0.35rem;
	font-size: 0.72rem;
	color: #6b7280;
	line-height: 1.4;
	padding: 0.15rem 0;
}

.ac-reasons li::before {
	content: '';
	flex-shrink: 0;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	margin-top: 0.35rem;
}

.ac-reasons--rec li::before      { background: #059669; }
.ac-reasons--rej li::before      { background: #dc2626; }
.ac-reasons--filt li::before     { background: #d97706; }
.ac-reasons--withdraw li::before { background: #2563eb; }

/* ── Back button ────────────────────────────────── */
.ac-btn-back {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.4rem 0.85rem;
	border-radius: 6px;
	font-size: 0.78rem;
	font-weight: 500;
	color: #6b7280;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	text-decoration: none;
	transition: all .15s ease;
}

.ac-btn-back:hover {
	background: #e5e7eb;
	color: #374151;
}

/* ── Pagination  ────────────────────────────────── */
.ac-pagination .pagination {
	gap: 0.25rem;
	margin-bottom: 0;
}

.ac-pagination .page-item .page-link {
	border-radius: 6px;
	font-size: 0.78rem;
	font-weight: 500;
	padding: 0.35rem 0.7rem;
	border: 1px solid #e9ecef;
	color: #495057;
	transition: all 0.15s ease;
}

.ac-pagination .page-item.active .page-link {
	background: var(--a);
	border-color: var(--a);
	color: #fff;
}

.ac-pagination .page-item .page-link:hover {
	background: #f8f9fa;
	border-color: #ced4da;
}

.ac-pagination .page-item.active .page-link:hover {
	background: var(--btn-hover);
	border-color: var(--btn-hover);
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 991.98px) {
	.ac-stats {
		grid-template-columns: repeat(2, 1fr);
	}
	.ac-run {
		grid-template-columns: 40px 1fr auto;
	}
	.ac-run-num {
		width: 34px;
		height: 34px;
		font-size: 0.72rem;
	}
}

@media (max-width: 575.98px) {
	.ac-stats {
		grid-template-columns: 1fr 1fr;
	}
	.ac-run-stats {
		gap: 0.4rem;
	}
	.ac-run-chip {
		font-size: 0.65rem;
		padding: 0.1rem 0.4rem;
	}
	.ac-decision-metrics {
		grid-template-columns: repeat(2, 1fr);
	}
}
