/*
 * Agent Lane: admin styles (queue page, settings page, dashboard widget).
 * Loaded only on the plugin pages and the dashboard.
 */

.agentlane-wrap .agentlane-intro {
	max-width: 760px;
	color: #50575e;
}

.agentlane-muted {
	color: #787c82;
}

/* Tabs */
.agentlane-tabs .nav-tab .count {
	color: #787c82;
	font-weight: 400;
	margin-left: 2px;
}

.agentlane-tabs .nav-tab-active .count {
	color: #1d2327;
}

/*
 * Table layout. The list table uses table-layout: fixed, so every column with a width
 * takes it from the table and the Fields column (no width) gets what is left. Keep the
 * sum of the percentages at or under 80: non-sortable headers add 20px of padding on
 * top of their percentage, and Fields needs about a fifth of the table to stay readable.
 */
.agentlane-table th.column-time,
.agentlane-table td.column-time {
	width: 10%;
}

.agentlane-table th.column-form,
.agentlane-table td.column-form {
	width: 10%;
}

.agentlane-table th.column-class,
.agentlane-table td.column-class {
	width: 14%;
}

.agentlane-table th.column-score,
.agentlane-table td.column-score {
	width: 7%;
}

.agentlane-table th.column-reasons,
.agentlane-table td.column-reasons {
	width: 19%;
}

.agentlane-table th.column-ip,
.agentlane-table td.column-ip {
	width: 10%;
}

/* A truncated IPv4 address stays on one line. */
.agentlane-table td.column-ip code {
	font-size: 12px;
	padding: 2px 3px;
}

.agentlane-table th.column-actions,
.agentlane-table td.column-actions {
	width: 9%;
}

.agentlane-table td {
	vertical-align: top;
}

.agentlane-table abbr[title] {
	text-decoration: none;
	border-bottom: 1px dotted #a7aaad;
	cursor: help;
}

.agentlane-status {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

/* Class badges */
.agentlane-badge {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 10px;
	font-size: 12px;
	line-height: 18px;
	font-weight: 500;
	white-space: nowrap;
	background: #f0f0f1;
	color: #1d2327;
}

.agentlane-badge-human {
	background: #e6f4ea;
	color: #1e6b36;
}

.agentlane-badge-bot {
	background: #fbe9e7;
	color: #a4280f;
}

.agentlane-badge-agent_suspected {
	background: #fdf1d8;
	color: #8a5a00;
}

.agentlane-badge-agent_declared {
	background: #e8eefc;
	color: #1f3f99;
}

.agentlane-badge-agent_verified {
	background: #e3f2fd;
	color: #0b4f8c;
}

/* Score bar */
.agentlane-score {
	display: inline-block;
	width: 48px;
	height: 6px;
	border-radius: 3px;
	background: #e0e0e0;
	vertical-align: middle;
	margin-right: 6px;
	overflow: hidden;
}

.agentlane-score-bar {
	display: block;
	height: 100%;
	background: #4caf50;
}

.agentlane-score-mid .agentlane-score-bar {
	background: #f0a000;
}

.agentlane-score-high .agentlane-score-bar {
	background: #d63638;
}

.agentlane-score-num {
	font-variant-numeric: tabular-nums;
	vertical-align: middle;
}

/* Reasons */
.agentlane-reasons {
	margin: 0;
	padding: 0;
	list-style: none;
}

.agentlane-reasons li {
	margin: 0 0 2px;
	line-height: 1.4;
}

.agentlane-weight {
	display: inline-block;
	min-width: 28px;
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	color: #787c82;
}

/* Fields */
.agentlane-field {
	line-height: 1.4;
	word-break: break-word;
}

.agentlane-field-name {
	color: #787c82;
}

.agentlane-field-name::after {
	content: ":";
}

.agentlane-fields-all {
	margin-top: 4px;
}

.agentlane-fields-all summary {
	cursor: pointer;
	color: #2271b1;
	font-size: 12px;
}

.agentlane-fields-all dl {
	margin: 6px 0 0;
	padding: 8px 10px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 3px;
	max-height: 320px;
	overflow: auto;
}

.agentlane-fields-all dt {
	font-weight: 600;
	margin: 6px 0 2px;
}

.agentlane-fields-all dt:first-child {
	margin-top: 0;
}

.agentlane-fields-all dd {
	margin: 0;
	white-space: pre-wrap;
	word-break: break-word;
}

/* Row actions */
.agentlane-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.agentlane-actions .agentlane-delete {
	color: #b32d2e;
	border-color: #b32d2e;
}

.agentlane-actions .agentlane-delete:hover {
	background: #fbe9e7;
}

.agentlane-row-bot td.column-time {
	border-left: 3px solid #d63638;
}

.agentlane-row-agent_suspected td.column-time,
.agentlane-row-agent_declared td.column-time,
.agentlane-row-agent_verified td.column-time {
	border-left: 3px solid #f0a000;
}

/* Settings */
.agentlane-settings .form-table th {
	width: 240px;
}

.agentlane-honeypot-name {
	font-size: 13px;
	padding: 4px 8px;
	margin-right: 6px;
}

.agentlane-policy-table {
	max-width: 900px;
	margin-top: 4px;
}

.agentlane-policy-table th,
.agentlane-policy-table td {
	vertical-align: middle;
}

/* The table sits inside .form-table, whose th rule (200px wide label, no left padding) must not leak into it. */
.agentlane-settings .form-table .agentlane-policy-table th {
	width: auto;
	padding: 8px 10px;
}

.agentlane-policy-table select {
	min-width: 130px;
}

/* Dashboard widget */
.agentlane-widget-totals {
	display: flex;
	gap: 12px;
	margin-bottom: 10px;
}

.agentlane-widget-total {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 10px 6px;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	text-decoration: none;
	color: #1d2327;
}

.agentlane-widget-total:hover {
	border-color: #2271b1;
}

.agentlane-widget-num {
	font-size: 24px;
	font-weight: 600;
	line-height: 1.2;
}

.agentlane-widget-label {
	font-size: 12px;
	color: #787c82;
}

.agentlane-widget-classes {
	margin: 0 0 8px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px 12px;
}

.agentlane-widget-classes li {
	margin: 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.agentlane-widget-count {
	font-variant-numeric: tabular-nums;
}

.agentlane-widget-held {
	margin: 0;
	padding-top: 8px;
	border-top: 1px solid #f0f0f1;
}

/*
 * Between the WordPress mobile breakpoint and a small laptop the eight columns do not
 * fit: drop the IP column (it comes back in the stacked mobile view) and let the class
 * badge wrap instead of running into the next column.
 */
@media screen and (min-width: 783px) and (max-width: 1200px) {
	.agentlane-table th.column-ip,
	.agentlane-table td.column-ip {
		display: none;
	}

	.agentlane-table th.column-form,
	.agentlane-table td.column-form {
		width: 11%;
	}

	.agentlane-table th.column-actions,
	.agentlane-table td.column-actions {
		width: 12%;
	}

	.agentlane-badge {
		white-space: normal;
	}
}

@media screen and (max-width: 782px) {
	.agentlane-table td.column-actions .agentlane-actions {
		flex-direction: column;
	}

	.agentlane-widget-classes {
		grid-template-columns: 1fr;
	}
}
