@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
	--bg: #f3f8f7;
	--surface: #ffffff;
	--surface-soft: #f7fbfa;
	--border: #d8e5e2;
	--text: #14322d;
	--muted: #4f6c66;
	--brand: #0a7f62;
	--brand-ink: #0d4b3b;
	--danger: #b8324f;
	--success: #1b8f50;
	--warning: #c0780f;
	--shadow: 0 8px 24px rgba(13, 57, 49, 0.08);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 24px;
	font-family: 'Manrope', 'Segoe UI', sans-serif;
	color: var(--text);
	background:
		radial-gradient(circle at 10% 10%, #def4ea 0%, transparent 38%),
		radial-gradient(circle at 92% 2%, #e3f5ff 0%, transparent 42%),
		linear-gradient(180deg, #eef6f4 0%, #f6fbfa 42%, #f3f8f7 100%);
}

header {
	background: linear-gradient(135deg, #13463b 0%, #0f3a31 100%);
	border: 1px solid #1d5b4d;
	border-radius: 14px;
	box-shadow: var(--shadow);
	padding: 16px 20px;
	margin-bottom: 18px;
}

h1 {
	margin: 0 0 10px;
	color: #e8fff8;
	font-size: 1.4rem;
	font-weight: 800;
	letter-spacing: 0.01em;
}

h2, h3, h4 {
	color: #15433a;
}

nav {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

nav a {
	text-decoration: none;
	color: #d3fff3;
	font-weight: 700;
	font-size: 0.95rem;
	padding: 5px 9px;
	border-radius: 8px;
	border: 1px solid rgba(199, 255, 239, 0.28);
	background: rgba(255, 255, 255, 0.06);
}

nav a:hover {
	background: rgba(255, 255, 255, 0.14);
}

main {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 18px;
	box-shadow: var(--shadow);
}

.user-chip {
	margin-left: auto;
	color: #d8f1eb;
	font-size: 0.9rem;
	font-weight: 600;
}

table {
	width: 100%;
	border-collapse: collapse;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	overflow: hidden;
}

th,
td {
	border-bottom: 1px solid var(--border);
	padding: 10px 12px;
	vertical-align: top;
}

th {
	font-size: 0.85rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--brand-ink);
	background: linear-gradient(180deg, #e9f6f2 0%, #e2f1ed 100%);
}

tr:nth-child(even) td {
	background: var(--surface-soft);
}

tr:hover td {
	background: #edf8f5;
}

a {
	color: var(--brand);
	font-weight: 700;
}

button,
input,
select,
textarea {
	font-family: 'Manrope', 'Segoe UI', sans-serif;
	font-size: 0.95rem;
}

button {
	background: linear-gradient(180deg, #17a07c 0%, #0f7e61 100%);
	color: #f4fffb;
	border: 1px solid #0e7358;
	border-radius: 9px;
	padding: 7px 12px;
	font-weight: 700;
	cursor: pointer;
}

button:hover {
	filter: brightness(1.05);
}

input,
select,
textarea {
	border: 1px solid #b9d2cc;
	border-radius: 8px;
	padding: 7px 9px;
	background: #fbfffe;
	color: var(--text);
}

textarea {
	width: 100%;
	max-width: 420px;
}

pre {
	margin: 0;
	font-family: 'IBM Plex Mono', Consolas, monospace;
	font-size: 0.82rem;
	white-space: pre-wrap;
	word-break: break-word;
	background: #f2f8f7;
	border: 1px solid #d4e3df;
	border-radius: 8px;
	padding: 8px;
}

.flashes {
	list-style: none;
	padding: 0;
	margin: 0 0 12px;
}

.flash {
	padding: 10px 12px;
	margin-bottom: 8px;
	border-radius: 9px;
	border: 1px solid transparent;
	font-weight: 600;
}

.flash.error {
	background: #ffe8ed;
	border-color: #f6b5c3;
	color: #8f1b36;
}

.flash.success {
	background: #e9ffef;
	border-color: #bdecc9;
	color: #196f40;
}

.flash.info {
	background: #e8f3ff;
	border-color: #bbd8f7;
	color: #194f84;
}

.crawl-help-link {
	font-size: 0.85rem;
	font-weight: 700;
	margin-left: 10px;
	text-decoration: underline;
}

.help-link,
.crawl-help-link {
	cursor: pointer;
}

.crawl-help-panel {
	background: #f1faf7;
	border: 1px solid #cbe5de;
	border-radius: 10px;
	padding: 10px 12px;
	margin: 0 0 16px;
}

.crawl-help-panel h4 {
	margin: 0 0 8px;
}

.crawl-help-panel ul {
	margin: 0;
	padding-left: 18px;
	color: var(--muted);
}

.crawl-form {
	display: grid;
	gap: 12px;
	padding: 12px;
	border: 1px solid #d9e9e5;
	border-radius: 10px;
	background: #fbfffe;
}

.crawl-form label {
	display: grid;
	gap: 6px;
	font-weight: 600;
	color: #19483f;
}

.crawl-grid-full,
.crawl-grid-2,
.crawl-grid-3,
.crawl-grid-4,
.crawl-grid-5 {
	display: grid;
	gap: 10px;
}

.crawl-grid-full {
	grid-template-columns: 1fr;
}

.crawl-grid-2 {
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.crawl-grid-3 {
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.crawl-grid-4 {
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.crawl-grid-5 {
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.crawl-form input[type="text"],
.crawl-form input[type="url"],
.crawl-form input[type="number"] {
	width: 100%;
	max-width: 100%;
}

.crawl-form select {
	width: 100%;
	max-width: 100%;
}

.crawl-checkbox-label {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	padding: 7px 9px;
	border: 1px solid #d9e9e5;
	border-radius: 8px;
	background: #f6fbfa;
	min-height: 40px;
}

.crawl-checkbox-label span {
	padding-right: 8px;
}

.help-link {
	font-size: 0.85rem;
	font-weight: 700;
	margin-left: 10px;
	text-decoration: underline;
}

.help-panel {
	background: #f1faf7;
	border: 1px solid #cbe5de;
	border-radius: 10px;
	padding: 10px 12px;
	margin: 0 0 16px;
}

.help-panel h4 {
	margin: 0 0 8px;
}

.help-panel ul {
	margin: 0;
	padding-left: 18px;
	color: var(--muted);
}

.help-panel,
.crawl-help-panel {
	display: none;
}

.help-panel.is-open,
.crawl-help-panel.is-open {
	display: block;
}

.help-panel:target,
.crawl-help-panel:target {
	display: block;
}

.risk-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 0.82rem;
	font-weight: 800;
	border: 1px solid transparent;
}

.risk-info {
	background: #edf3f7;
	color: #3a5664;
	border-color: #d5e2ea;
}

.risk-low {
	background: #edf8f0;
	color: #1f6f41;
	border-color: #cce8d6;
}

.risk-medium {
	background: #fff5e7;
	color: #8c5a17;
	border-color: #f0d7ad;
}

.risk-high {
	background: #ffecea;
	color: #9c3427;
	border-color: #f2c5bf;
}

.risk-critical {
	background: #ffe4e9;
	color: #8a1838;
	border-color: #efb6c4;
}

.status-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	border: 1px solid transparent;
}

button.status-badge-button {
	background: transparent;
	padding: 2px 8px;
	line-height: 1.2;
	box-shadow: none;
}

button.status-badge-button:hover {
	filter: none;
	opacity: 0.9;
}

.status-success {
	background: #edf8f0;
	color: #1f6f41;
	border-color: #cce8d6;
}

.status-partial {
	background: #fff5e7;
	color: #8c5a17;
	border-color: #f0d7ad;
}

.status-failed {
	background: #ffecea;
	color: #9c3427;
	border-color: #f2c5bf;
}

.status-running {
	background: #edf3f7;
	color: #3a5664;
	border-color: #d5e2ea;
}

.status-unknown {
	background: #f0f2f3;
	color: #566369;
	border-color: #dbe0e2;
}

.inline-error-text {
	color: #8a1838;
	font-weight: 600;
	word-break: break-word;
}

.cms-action-stack {
	display: grid;
	gap: 8px;
	min-width: 122px;
}

.cms-action-stack form {
	margin: 0;
}

.cms-action-button {
	width: 100%;
	min-width: 122px;
	text-align: center;
}

.cms-action-danger {
	background: linear-gradient(180deg, #c05f4d 0%, #9f4535 100%);
	border-color: #8f3b2c;
	color: #fff7f5;
}

.posture-section {
	margin: 0 0 18px;
}

.posture-section h3 {
	margin: 0 0 10px;
}

.posture-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 10px;
	margin-bottom: 10px;
}

.posture-card {
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 10px 12px;
	background: #fbfffe;
	display: grid;
	gap: 4px;
}

.posture-card strong {
	font-size: 0.8rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--muted);
}

.posture-card span {
	font-size: 1.2rem;
	font-weight: 800;
	color: var(--brand-ink);
}

.table-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.table-action-button {
	padding: 6px 10px;
	font-size: 0.88rem;
}

.details-trigger {
	background: linear-gradient(180deg, #eff8f5 0%, #dcefe8 100%);
	color: var(--brand-ink);
	border-color: #bcd8cf;
}

.dim-modal {
	width: min(720px, calc(100vw - 32px));
	max-height: min(88vh, 900px);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 0;
	box-shadow: 0 20px 60px rgba(9, 32, 28, 0.22);
	background: var(--surface);
}

.dim-modal::backdrop {
	background: rgba(8, 29, 24, 0.42);
	backdrop-filter: blur(2px);
}

.dim-modal-body {
	padding: 18px;
	display: grid;
	gap: 14px;
}

.dim-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: start;
	gap: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--border);
}

.dim-modal-header h3 {
	margin: 0 0 4px;
}

.dim-modal-header p {
	margin: 0;
	color: var(--muted);
	font-size: 0.92rem;
	word-break: break-word;
}

.dim-modal-close {
	background: transparent;
	color: var(--muted);
	border: 1px solid var(--border);
	padding: 5px 10px;
}

.modal-workflow-form {
	display: grid;
	gap: 12px;
}

.modal-workflow-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
}

.modal-workflow-form label {
	display: grid;
	gap: 6px;
	font-weight: 600;
	color: #19483f;
}

.modal-workflow-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding-top: 4px;
}

.modal-details-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 10px;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface-soft);
}

.modal-details-card {
	display: grid;
	gap: 3px;
}

.modal-details-card strong {
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
}

.modal-details-pre {
	max-height: 48vh;
	overflow: auto;
}

.modal-payload-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 10px;
}

.modal-payload-card {
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: #fbfffe;
	display: grid;
	gap: 6px;
}

.modal-payload-card strong {
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
}

.modal-payload-card span {
	word-break: break-word;
}

.modal-inline-pre {
	padding: 6px;
	font-size: 0.78rem;
	max-height: 160px;
	overflow: auto;
}

@media (max-width: 720px) {
	.dim-modal {
		width: calc(100vw - 20px);
	}

	.dim-modal-body {
		padding: 14px;
	}

	.thin-hide-mobile {
		display: none;
	}
}
