/* ======================================================
   BASE
   ====================================================== */

body {
	background: #f5f5f5;
}

.demo-container {
	max-width: 1800px;
	padding-left: 24px;
	padding-right: 24px;
}

.section-card {
	border: 1px solid #ddd;
	border-radius: 1rem;
	box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.04);
}

.api-focus-card {
	border-width: 2px;
}

/* ======================================================
   PAGE HEADER
   ====================================================== */

.demo-title-wrap {
	display: flex;
	align-items: center;
	gap: 18px;
}

.demo-title-badge {
	width: 72px;
	height: 72px;
	object-fit: contain;
	flex: 0 0 auto;
	margin-top: 2px;
}

/* ======================================================
   AGENTS
   ====================================================== */

.agent-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.agent-card {
	border: 1px solid #e3e3e3;
	border-radius: 1rem;
	padding: 1rem;
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.agent-card.is-active {
	border-color: #8db3ff;
	box-shadow: 0 0.5rem 1.25rem rgba(13, 110, 253, 0.1);
	transform: translateY(-1px);
}

.agent-card-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.agent-name {
	font-weight: 700;
	line-height: 1.2;
}

.agent-role {
	font-size: 0.9rem;
	color: #6c757d;
}

.agent-state {
	padding: 0.3rem 0.6rem;
	border-radius: 999px;
	background: #f1f3f5;
	color: #495057;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
}

.agent-card.is-active .agent-state {
	background: #dbeafe;
	color: #1d4ed8;
}

.agent-perms {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-bottom: 0.75rem;
}

.agent-perms span {
	padding: 0.35rem 0.6rem;
	border-radius: 999px;
	background: #f8f9fa;
	border: 1px solid #e9ecef;
	font-size: 0.8rem;
}

.agent-token {
	font-size: 0.82rem;
	color: #6c757d;
}

/* ======================================================
   SECURITY / APIBASE
   ====================================================== */

.security-box {
	padding: 1rem;
	border: 1px solid #e9ecef;
	border-radius: 0.85rem;
	background: #fafafa;
}

.security-line {
	font-size: 0.92rem;
	margin-bottom: 0.45rem;
	color: #343a40;
	word-break: break-word;
}

.action-summary {
	padding: 0.9rem 1rem;
	border-radius: 0.85rem;
	background: #111827;
	color: #fff;
	font-size: 0.92rem;
	line-height: 1.45;
}

.api-call-summary {
	padding: 0.9rem 1rem;
	border: 1px solid #e9ecef;
	border-radius: 0.85rem;
	background: #fafafa;
	font-size: 0.92rem;
	line-height: 1.45;
}

.api-call-code,
.api-output {
	margin: 0;
	padding: 1rem;
	overflow: auto;
	border-radius: 0.75rem;
	background: #111;
	color: #00ff66;
	font-size: 0.82rem;
	line-height: 1.45;
	white-space: pre-wrap;
	word-break: break-word;
}

.api-call-code {
	min-height: 260px;
}

.api-call-code-lg {
	min-height: 340px;
	font-size: 0.92rem;
}

.api-output {
	min-height: 320px;
}

.tlc-header {
	display: flex;
	align-items: center;
	gap: 12px;
}

.tlc-logo {
	width: 44px;
	height: 44px;
	object-fit: contain;
	flex: 0 0 auto;
}

/* ======================================================
   FLOW
   ====================================================== */

.execution-log {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	max-height: 320px;
	overflow: auto;
}

.execution-log-lg {
	min-height: 420px;
	max-height: 520px;
}

.log-item {
	border: 1px solid #e5e5e5;
	border-radius: 0.85rem;
	padding: 0.85rem 1rem;
	background: #fff;
}

.log-time {
	font-size: 0.78rem;
	color: #6c757d;
	margin-bottom: 0.3rem;
}

.log-text {
	font-size: 0.92rem;
	line-height: 1.45;
}

.log-info {
	border-left: 4px solid #adb5bd;
}

.log-success {
	border-left: 4px solid #198754;
}

.log-warning {
	border-left: 4px solid #fd7e14;
}

/* ======================================================
   ORDERS TABLE
   ====================================================== */

.orders-wrap {
	min-height: 180px;
}

.table-wrap {
	width: 100%;
	overflow-x: auto;
}

.orders-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 0.95rem;
	background: #fff;
}

.orders-table thead th {
	padding: 0.9rem 0.8rem;
	border-bottom: 1px solid #dee2e6;
	background: #f8f9fa;
	font-weight: 700;
	white-space: nowrap;
	text-align: left;
}

.orders-table tbody td {
	padding: 0.85rem 0.8rem;
	border-bottom: 1px solid #f0f0f0;
	vertical-align: middle;
	text-align: left;
	white-space: nowrap;
}

.orders-table tbody tr:hover {
	background: #fcfcfc;
}

.orders-table .col-order {
	font-weight: 600;
}

.orders-table .col-actions {
	width: 1%;
	white-space: nowrap;
}

.col-order,
.col-client,
.col-created {
	white-space: nowrap;
}

/* ======================================================
   STATUS / ACTIONS
   ====================================================== */

.badge-status {
	display: inline-flex;
	align-items: center;
	padding: 0.45rem 0.7rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	border: 1px solid #dee2e6;
	background: #f8f9fa;
	color: #495057;
}

.badge-new {
	background: #fff3cd;
	color: #856404;
	border-color: #ffe69c;
}

.badge-reserved {
	background: #dbeafe;
	color: #1d4ed8;
	border-color: #bfdbfe;
}

.badge-shipped {
	background: #d1e7dd;
	color: #0f5132;
	border-color: #badbcc;
}

.btn-action {
	border: 1px solid #ced4da;
	background: #fff;
	color: #212529;
	border-radius: 0.6rem;
	padding: 0.45rem 0.75rem;
	font-size: 0.85rem;
	font-weight: 600;
	transition: all 0.15s ease;
	cursor: pointer;
}

.btn-action:hover {
	background: #212529;
	color: #fff;
	border-color: #212529;
}

/* ======================================================
   EMPTY STATE
   ====================================================== */

.empty-state {
	padding: 1rem;
	border: 1px dashed #ced4da;
	border-radius: 0.75rem;
	background: #fafafa;
	color: #6c757d;
	text-align: center;
}
.orders-note {
	padding: 0.85rem 1rem;
	border: 1px solid #e9ecef;
	border-radius: 0.85rem;
	background: #fafafa;
	color: #495057;
	font-size: 0.9rem;
	line-height: 1.45;
}

.orders-note code {
	font-size: 0.88em;
}

.api-call-code-lg {
	min-height: 300px;
	font-size: 0.9rem;
}

.execution-log-lg {
	min-height: 320px;
	max-height: 420px;
}

.resolve-ref {
	border: 0;
	background: transparent;
	padding: 0;
	margin: 0;
	color: #0d6efd;
	font: inherit;
	cursor: pointer;
	text-decoration: underline;
}

.resolve-ref:hover {
	color: #0a58ca;
}

.resolve-ref:disabled {
	opacity: 0.6;
	cursor: wait;
}

.resolve-ref.is-resolved {
	color: #212529;
	text-decoration: none;
	font-weight: 600;
}

.orders-feedback {
	padding: 0.9rem 1rem;
	border-radius: 0.85rem;
	border: 1px solid transparent;
	font-size: 0.92rem;
	line-height: 1.45;
}

.orders-feedback-info {
	background: #f8f9fa;
	border-color: #e9ecef;
	color: #495057;
}

.orders-feedback-success {
	background: #d1e7dd;
	border-color: #badbcc;
	color: #0f5132;
}

.orders-feedback-warning {
	background: #fff3cd;
	border-color: #ffe69c;
	color: #856404;
}
/* ======================================================
   RESPONSIVE
   ====================================================== */

@media (max-width: 1399.98px) {
	.execution-log-lg {
		min-height: 320px;
		max-height: 420px;
	}
}

@media (max-width: 1199.98px) {
	.demo-container {
		max-width: 100%;
	}
}

@media (max-width: 991.98px) {
	.execution-log {
		max-height: none;
	}
}

@media (max-width: 767.98px) {
	.demo-title-badge {
		width: 56px;
		height: 56px;
	}
}