:root {
	--bg-start: #f4efe5;
	--bg-end: #dce7f0;
	--panel: #ffffff;
	--text: #182029;
	--muted: #5e6774;
	--brand-ink: #213248;
	--accent: #ef6a38;
	--border: #d6dce3;
	--success-bg: #e6f6ea;
	--success-text: #1f7a40;
	--warn-bg: #fff4d4;
	--warn-text: #7d5a00;
	--danger-bg: #ffe8e8;
	--danger-text: #b91c1c;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: 'Space Grotesk', 'Avenir Next', 'Segoe UI', sans-serif;
	color: var(--text);
	background:
		radial-gradient(circle at 12% 12%, rgba(239, 106, 56, 0.16) 0%, transparent 32%),
		radial-gradient(circle at 85% 0%, rgba(33, 50, 72, 0.15) 0%, transparent 45%),
		linear-gradient(165deg, var(--bg-start), var(--bg-end));
	min-height: 100vh;
}

header {
	padding: 22px 24px;
	background: linear-gradient(120deg, #1f2b3b 0%, #1f3f5f 100%);
	color: #fff;
	border-bottom: 2px solid rgba(255, 255, 255, 0.18);
}

.header-inner {
	max-width: 1400px;
	margin: 0 auto;
	display: flex;
	gap: 16px;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
}

.header-main h1 {
	margin: 8px 0 4px;
	font-size: clamp(24px, 3vw, 36px);
	line-height: 1.05;
	letter-spacing: 0.01em;
}

.header-subtitle {
	margin: 0;
	color: rgba(240, 247, 255, 0.92);
	font-size: 15px;
}

.dashboard-shell {
	max-width: 1400px;
	margin: 0 auto;
	padding: 22px;
	display: grid;
	gap: 16px;
	animation: dashboard-enter 420ms ease-out;
}

.hero-panel,
.dash-card {
	background: var(--panel);
	border: 1px solid rgba(24, 32, 41, 0.08);
	border-radius: 14px;
	box-shadow: 0 10px 28px rgba(19, 28, 45, 0.08);
}

.hero-panel {
	padding: 18px;
	display: flex;
	gap: 16px;
	justify-content: space-between;
	align-items: flex-start;
	flex-wrap: wrap;
}

.hero-kicker {
	margin: 0;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--accent);
	font-weight: 700;
}

.hero-panel h2 {
	margin: 8px 0 4px;
	font-size: clamp(22px, 3vw, 34px);
	line-height: 1.1;
}

.hero-panel p {
	margin: 0;
	color: var(--muted);
}

.hero-stats,
.header-stats {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.stat-chip {
	min-width: 150px;
	padding: 10px 12px;
	border-radius: 10px;
	background: #f5f8fb;
	border: 1px solid var(--border);
}

.header-stats .stat-chip {
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.22);
	backdrop-filter: blur(1px);
}

.stat-label {
	display: block;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #5c6878;
	font-weight: 600;
}

.stat-value {
	display: block;
	margin-top: 4px;
	font-size: 14px;
	font-weight: 700;
	font-family: 'IBM Plex Mono', monospace;
	color: #1a2738;
}

.header-stats .stat-label {
	color: rgba(235, 245, 255, 0.88);
}

.header-stats .stat-value {
	color: #fff;
}

.dash-card { padding: 14px; }

.section-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.section-head h3 {
	margin: 0;
	font-size: 18px;
	letter-spacing: 0.01em;
}

.section-note {
	font-size: 12px;
	color: var(--muted);
}

.table-wrap {
	border: 1px solid var(--border);
	border-radius: 10px;
	overflow-x: auto;
	background: #fff;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

th {
	text-align: left;
	padding: 12px 10px;
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #2d3f56;
	background: #edf3f8;
	border-bottom: 1px solid var(--border);
	white-space: nowrap;
}

td {
	padding: 10px;
	border-bottom: 1px solid #eef2f6;
	vertical-align: top;
}

tr:hover td {
	background: #f8fbfd;
}

.tx-log-row {
	cursor: pointer;
}

.tx-log-row td {
	vertical-align: middle;
}

.tx-log-row:hover td {
	background: #f2f8fe;
}

.row-empty td {
	text-align: center;
	color: var(--muted);
	padding: 20px;
}

.status-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.status-pill.is-success {
	background: var(--success-bg);
	color: var(--success-text);
}

.status-pill.is-pending {
	background: var(--warn-bg);
	color: var(--warn-text);
}

.status-pill.is-failed {
	background: var(--danger-bg);
	color: var(--danger-text);
}

.inline-alert,
.inline-note {
	margin: 0 0 12px;
	padding: 8px 10px;
	border-radius: 8px;
	font-size: 13px;
}

.inline-alert {
	background: #fff1f1;
	color: #991b1b;
	border: 1px solid #ffd3d3;
}

.inline-note {
	background: #f4f8fb;
	color: #425163;
	border: 1px solid #d9e3ed;
}

.dataTables_wrapper {
	padding: 10px;
	color: var(--text);
	font-size: 13px;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 6px 8px;
	font-family: 'Space Grotesk', sans-serif;
}

#transaction-log-table_length,
#transaction-log-table_filter {
	height: 40px;
	display: flex;
	align-items: flex-start;
}

#transaction-log-table_info,
#transaction-log-table_paginate {
	height: 40px;
	display: flex;
	align-items: center;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
	border-radius: 8px !important;
	border: 1px solid transparent !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
	background: #213248 !important;
	color: #fff !important;
	border-color: #213248 !important;
}

.modal-shell {
	position: fixed;
	inset: 0;
	z-index: 5000;
	display: grid;
	place-items: center;
	padding: 20px;
}

.modal-shell[hidden] {
	display: none !important;
}

.modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(13, 19, 27, 0.66);
	backdrop-filter: blur(2px);
}

.modal-card {
	position: relative;
	width: min(1400px, 96vw);
	max-height: 92vh;
	overflow: auto;
	background: #fff;
	border: 1px solid rgba(24, 32, 41, 0.14);
	border-radius: 14px;
	box-shadow: 0 22px 56px rgba(9, 14, 22, 0.35);
	padding: 14px;
	animation: dashboard-enter 220ms ease-out;
}

.modal-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.modal-head h3 {
	margin: 0;
	font-size: 20px;
}

.modal-close-btn {
	border: 1px solid #cad4df;
	background: #f6f9fc;
	border-radius: 8px;
	padding: 7px 12px;
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 600;
	cursor: pointer;
}

.modal-close-btn:hover {
	background: #ebf1f8;
}

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

.modal-pane {
	border: 1px solid #d8e0ea;
	border-radius: 10px;
	background: #fcfdff;
	padding: 10px;
	min-height: 80px;
}

.modal-pane h4 {
	margin: 0 0 8px;
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #31465f;
}

.modal-pane-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
}

.modal-pane-head h4 {
	margin: 0;
}

.modal-pane-head-main {
	min-width: 0;
}

.modal-pane-subtext {
	margin: 3px 0 0;
	font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 11px;
	line-height: 1.3;
	color: #62758a;
	overflow-wrap: anywhere;
}

.response-meta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.response-duration {
	font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 11px;
	color: #5d7084;
	border: 1px solid #d8e0ea;
	background: #f4f8fc;
	border-radius: 999px;
	padding: 2px 8px;
	white-space: nowrap;
}

.pane-download-btn {
	border: 1px solid #cad4df;
	background: #f6f9fc;
	border-radius: 8px;
	padding: 5px 10px;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 12px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	white-space: nowrap;
}

.pane-download-btn:hover:not(:disabled) {
	background: #ebf1f8;
}

.pane-download-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.modal-pane pre {
	margin: 0;
	padding: 10px;
	background: #0f1724;
	color: #d8e6f5;
	border-radius: 8px;
	font-size: 12px;
	line-height: 1.45;
	font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
	overflow: auto;
	max-height: 66vh;
	white-space: pre-wrap;
	word-break: break-word;
}

.tx-summary-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.tx-summary-item {
	border: 1px solid #d8e0ea;
	border-radius: 8px;
	background: #f7fafc;
	padding: 10px;
}

.tx-summary-label {
	display: block;
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #5a7088;
	margin-bottom: 4px;
}

.tx-summary-value {
	display: block;
	color: #1b2a3f;
	font-size: 14px;
	font-weight: 600;
	word-break: break-word;
}

@keyframes dashboard-enter {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
	header { padding: 18px 16px; }
	.header-subtitle { font-size: 14px; }
	.dashboard-shell { padding: 14px; }
	.hero-panel { padding: 14px; }
	.dash-card { padding: 10px; }
	th, td { padding: 8px; font-size: 12px; }
	.modal-shell { padding: 8px; }
	.modal-card { padding: 10px; width: min(1400px, 99vw); max-height: 95vh; }
	.tx-summary-grid { grid-template-columns: 1fr; }
}

.footer {
	text-align: center;
	color: #2f4055;
	margin: 16px auto 24px;
	font-size: 12px;
}
