/**
 * Agent Dashboard styles for Asystio plugin.
 *
 * BEM-style selectors scoped to .asystio-agent-dashboard so that these styles
 * do not affect the customer dashboard or any other plugin component.
 */

/* -----------------------------------------------------------------------
 * Wrapper
 * --------------------------------------------------------------------- */
.asystio-agent-dashboard {
	max-width: 1400px;
	margin: 0 auto;
	padding: 2rem 1rem;
}

/* -----------------------------------------------------------------------
 * Header
 * --------------------------------------------------------------------- */
.asystio-agent-dashboard-header {
	background: linear-gradient( 135deg, #1e3a5f 0%, #2d6a9f 100% );
	color: #fff;
	padding: 1.5rem 2rem;
	border-radius: 8px;
	margin-bottom: 2rem;
}

.asystio-agent-dashboard-header h2 {
	margin: 0;
	color: #fff;
	font-size: 1.5rem;
}

/* -----------------------------------------------------------------------
 * Stats grid
 * --------------------------------------------------------------------- */
.asystio-agent-stats {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 160px, 1fr ) );
	gap: 1rem;
	margin-bottom: 2rem;
}

.asystio-agent-stat-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1.25rem 1rem;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
}

.asystio-agent-stat-number {
	font-size: 2rem;
	font-weight: 700;
	color: #1e3a5f;
	line-height: 1;
}

.asystio-agent-stat-label {
	font-size: 13px;
	color: #6b7280;
}

.asystio-agent-stat-card--mine .asystio-agent-stat-number {
	color: #2d6a9f;
}

.asystio-agent-stat-card--unassigned .asystio-agent-stat-number {
	color: #d97706;
}

.asystio-agent-stat-card--closed .asystio-agent-stat-number {
	color: #6b7280;
}

/* -----------------------------------------------------------------------
 * Clickable stat card links
 * --------------------------------------------------------------------- */
.asystio-agent-dashboard .asystio-agent-stat-card-link {
	display: block;
	text-decoration: none;
	color: inherit;
	border-radius: 8px;
	transition: box-shadow 0.15s, transform 0.1s;
}

.asystio-agent-dashboard .asystio-agent-stat-card-link:hover {
	box-shadow: 0 4px 12px rgba( 0, 0, 0, 0.1 );
	transform: translateY( -1px );
}

.asystio-agent-dashboard .asystio-agent-stat-card-link:hover .asystio-agent-stat-card {
	border-color: #2d6a9f;
}

.asystio-agent-dashboard .asystio-agent-stat-card-link .asystio-agent-stat-card {
	transition: border-color 0.15s;
}

/* -----------------------------------------------------------------------
 * Queue navigation tabs
 * --------------------------------------------------------------------- */
.asystio-agent-dashboard-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin-bottom: 1.25rem;
	border-bottom: 2px solid #e5e7eb;
	padding-bottom: 0;
}

.asystio-agent-dashboard-tab {
	display: inline-block;
	padding: 0.6rem 1.1rem;
	font-size: 14px;
	font-weight: 500;
	color: #6b7280;
	text-decoration: none;
	border: 1px solid transparent;
	border-bottom: none;
	border-radius: 6px 6px 0 0;
	margin-bottom: -2px;
	transition: color 0.15s, background 0.15s, border-color 0.15s;
	background: transparent;
}

.asystio-agent-dashboard-tab:hover {
	color: #1e3a5f;
	background: #f1f5f9;
	border-color: #e5e7eb;
	text-decoration: none;
}

.asystio-agent-dashboard-tab.is-active {
	color: #1e3a5f;
	background: #fff;
	border-color: #e5e7eb;
	border-bottom-color: #fff;
	font-weight: 600;
}

/* -----------------------------------------------------------------------
 * Active filter summary
 * --------------------------------------------------------------------- */
.asystio-active-filter-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	margin-bottom: 0.75rem;
	padding: 0.5rem 0.75rem;
	background: #f0f7ff;
	border: 1px solid #c3daf9;
	border-radius: 6px;
	font-size: 13px;
	color: #374151;
}

.asystio-active-filter-showing strong {
	color: #1e3a5f;
}

.asystio-active-filter-list {
	color: #6b7280;
}

/* -----------------------------------------------------------------------
 * Filters form
 * --------------------------------------------------------------------- */
.asystio-agent-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 1.5rem;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1rem;
}

.asystio-agent-filters .asystio-input {
	flex: 1 1 160px;
	min-width: 140px;
}

.asystio-agent-filters .asystio-button-reset {
	background: #fff;
	border: 1px solid #d1d5db;
	color: #374151;
}

.asystio-agent-filters .asystio-button-reset:hover {
	background: #f3f4f6;
	color: #111827;
}

/* -----------------------------------------------------------------------
 * Ticket table
 * --------------------------------------------------------------------- */
.asystio-agent-ticket-table-wrap {
	overflow-x: auto;
}

.asystio-agent-ticket-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.asystio-agent-ticket-table thead th {
	background: #f1f5f9;
	color: #374151;
	font-weight: 600;
	padding: 0.75rem 1rem;
	text-align: left;
	border-bottom: 2px solid #e5e7eb;
	white-space: nowrap;
}

.asystio-agent-ticket-table tbody tr {
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.1s;
}

.asystio-agent-ticket-table tbody tr:hover {
	background: #f9fafb;
}

.asystio-agent-ticket-table tbody td {
	padding: 0.75rem 1rem;
	vertical-align: top;
	color: #374151;
}

.asystio-agent-ticket-table tbody td a {
	color: #2d6a9f;
	text-decoration: none;
}

.asystio-agent-ticket-table tbody td a:hover {
	text-decoration: underline;
}

.asystio-agent-ticket-table tbody td small {
	display: block;
	color: #6b7280;
	font-size: 12px;
}

/* -----------------------------------------------------------------------
 * Priority badges (reused from customer dashboard where applicable)
 * --------------------------------------------------------------------- */
.asystio-priority-low    { color: #6b7280; }
.asystio-priority-normal { color: #2563eb; }
.asystio-priority-high   { color: #d97706; font-weight: 600; }
.asystio-priority-urgent { color: #dc2626; font-weight: 700; }

/* -----------------------------------------------------------------------
 * Pagination
 * --------------------------------------------------------------------- */
.asystio-agent-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 1.5rem;
	justify-content: center;
}

.asystio-agent-pagination .asystio-page-link {
	display: inline-block;
	padding: 0.4rem 0.75rem;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	color: #374151;
	text-decoration: none;
	font-size: 13px;
	transition: background 0.1s, color 0.1s;
}

.asystio-agent-pagination .asystio-page-link:hover {
	background: #e5e7eb;
}

.asystio-agent-pagination .asystio-page-link.active {
	background: #1e3a5f;
	color: #fff;
	border-color: #1e3a5f;
}

/* -----------------------------------------------------------------------
 * Empty state
 * --------------------------------------------------------------------- */
.asystio-agent-dashboard .asystio-no-tickets,
.asystio-agent-dashboard .asystio-empty-state {
	padding: 2rem;
	text-align: center;
	color: #6b7280;
	background: #f9fafb;
	border-radius: 8px;
}

.asystio-agent-dashboard .asystio-empty-state p {
	margin: 0;
	font-size: 15px;
}

/* -----------------------------------------------------------------------
 * Responsive tweaks
 * --------------------------------------------------------------------- */
@media ( max-width: 768px ) {
	.asystio-agent-stats {
		grid-template-columns: repeat( 2, 1fr );
	}

	.asystio-agent-filters .asystio-input {
		flex: 1 1 100%;
	}

	.asystio-agent-dashboard-tabs {
		gap: 0;
	}

	.asystio-agent-dashboard-tab {
		padding: 0.5rem 0.75rem;
		font-size: 13px;
	}

	.asystio-active-filter-summary {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
	}
}

/* -----------------------------------------------------------------------
 * Agent ticket detail view (.asystio-agent-ticket-view)
 * --------------------------------------------------------------------- */
.asystio-agent-ticket-view {
	max-width: 900px;
	margin: 0 auto;
	padding: 2rem 1rem;
}

.asystio-agent-back-link {
	margin-bottom: 1.5rem;
}

.asystio-agent-back-link a {
	color: #2d6a9f;
	text-decoration: none;
	font-size: 14px;
}

.asystio-agent-back-link a:hover {
	text-decoration: underline;
}

/* Ticket detail header */
.asystio-agent-ticket-details {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1.5rem;
	margin-bottom: 2rem;
}

.asystio-agent-ticket-subject {
	margin: 0 0 1.25rem;
	font-size: 1.25rem;
	color: #111827;
}

.asystio-agent-ticket-meta-grid {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 260px, 1fr ) );
	gap: 0.5rem 2rem;
}

.asystio-agent-ticket-meta-row {
	display: flex;
	gap: 0.5rem;
	font-size: 14px;
}

.asystio-agent-ticket-meta-label {
	font-weight: 600;
	color: #6b7280;
	white-space: nowrap;
	min-width: 110px;
}

.asystio-agent-ticket-meta-value {
	color: #374151;
	word-break: break-word;
}

.asystio-agent-ticket-meta-value code {
	background: #f3f4f6;
	padding: 0.1rem 0.35rem;
	border-radius: 3px;
	font-size: 13px;
}

/* Original message */
.asystio-agent-original-message {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-left: 4px solid #2d6a9f;
	border-radius: 0 8px 8px 0;
	padding: 1.25rem;
	margin-bottom: 2rem;
}

.asystio-agent-message-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0.75rem;
	gap: 1rem;
}

.asystio-agent-message-date {
	font-size: 13px;
	color: #6b7280;
	white-space: nowrap;
}

.asystio-agent-message-body {
	color: #374151;
	font-size: 15px;
	line-height: 1.6;
}

.asystio-agent-message-attachments {
	margin-top: 0.75rem;
	font-size: 13px;
	color: #6b7280;
}

.asystio-agent-message-attachments a {
	color: #2d6a9f;
}

/* Conversation thread */
.asystio-agent-conversation {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 2rem;
}

.asystio-agent-reply {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1rem 1.25rem;
}

.asystio-agent-reply--staff {
	background: #f0f7ff;
	border-left: 4px solid #2d6a9f;
}

.asystio-agent-reply--customer {
	background: #fff;
	border-left: 4px solid #e5e7eb;
}

.asystio-agent-reply-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0.5rem;
	gap: 1rem;
}

.asystio-agent-reply-date {
	font-size: 12px;
	color: #6b7280;
	white-space: nowrap;
}

.asystio-staff-badge {
	display: inline-block;
	margin-left: 0.4rem;
	padding: 0.15rem 0.5rem;
	background: #2d6a9f;
	color: #fff;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	vertical-align: middle;
}

.asystio-agent-reply-body {
	color: #374151;
	font-size: 14px;
	line-height: 1.6;
}

.asystio-agent-reply-attachments {
	margin-top: 0.5rem;
	font-size: 13px;
	color: #6b7280;
}

.asystio-agent-reply-attachments a {
	color: #2d6a9f;
}

/* Internal notes */
.asystio-agent-internal-notes {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 8px;
	padding: 1.25rem;
	margin-bottom: 2rem;
}

.asystio-agent-internal-notes h3 {
	margin: 0 0 0.75rem;
	font-size: 1rem;
	color: #92400e;
}

.asystio-agent-internal-notes-body {
	color: #78350f;
	font-size: 14px;
	line-height: 1.6;
}

