/**
 * SiteStaffr Usage Dashboard Styles
 *
 * Styles for the Usage & Billing dashboard page displaying
 * minute balance, usage statistics, and billing history.
 *
 * @package    SiteStaffr
 * @subpackage SiteStaffr/admin/css
 * @since      1.0.0
 */

/* ====================================
   Usage Dashboard Container
   ==================================== */

.sitestaffr-usage-dashboard h1 {
	display: flex;
	align-items: center;
	margin-bottom: 20px;
}

/* ====================================
   Usage Sections
   ==================================== */

.sitestaffr-usage-section {
	background: #fff;
	border: 1px solid #e8e2d8;
	border-radius: 12px;
	padding: 14px 18px 16px;
	margin-top: 12px;
	margin-bottom: 20px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.06);
	overflow: hidden;
	min-width: 0;
}

/* First usage section — uniform 12px top spacing from header/alert */
.sitestaffr-usage-section:first-of-type {
	margin-top: 12px;
}

.sitestaffr-usage-section h2 {
	margin: -14px -18px 12px;
	font-size: 16px;
	border-bottom: 1px solid #f0ebe0;
	height: 60px;
	padding: 0 18px;
	background: #FAF8F4;
	color: #1d2327;
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	line-height: 1.2;
}

.sitestaffr-usage-section h2 .dashicons {
	color: #00838f;
	font-size: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	line-height: 16px;
	margin-top: 0;
}

.sitestaffr-usage-period-range {
	margin: 0 0 20px;
	color: #646970;
	font-size: 13px;
}

.sitestaffr-section-header-with-filters {
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 60px;
	flex-wrap: wrap;
	gap: 10px;
	margin: -14px -18px 12px;
	padding: 0 18px;
	border-bottom: 1px solid #f0ebe0;
	background: #FAF8F4;
	border-radius: 12px 12px 0 0;
}

.sitestaffr-section-header-with-filters h2,
.sitestaffr-section-header-with-actions h2 {
	margin: 0;
	padding: 0;
	font-size: 16px;
	font-weight: 600;
	color: #1d2327;
	display: flex;
	align-items: center;
	gap: 8px;
	background: transparent;
	border-bottom: 0;
	height: auto;
	border-radius: 0;
	line-height: 1.4;
}

.sitestaffr-section-header-with-filters h2 .dashicons,
.sitestaffr-section-header-with-actions h2 .dashicons {
	color: #00838f;
}

.sitestaffr-section-header-with-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 60px;
	flex-wrap: wrap;
	gap: 12px;
	margin: -14px -18px 12px;
	padding: 0 18px;
	border-bottom: 1px solid #f0ebe0;
	background: #FAF8F4;
	border-radius: 12px 12px 0 0;
}

/* h2 styling for section-header-with-actions is combined above
   with section-header-with-filters */

.sitestaffr-cycle-controls {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.sitestaffr-cycle-nav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	background: #fff;
	color: #2c3338;
	text-decoration: none;
}

.sitestaffr-cycle-nav-btn:hover,
.sitestaffr-cycle-nav-btn:focus {
	border-color: #2271b1;
	color: #2271b1;
}

.sitestaffr-cycle-nav-btn.is-disabled {
	opacity: 0.45;
	pointer-events: none;
}

.sitestaffr-cycle-picker {
	position: relative;
}

.sitestaffr-cycle-current-link {
	list-style: none;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
	cursor: pointer;
	text-decoration: none;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	background: #fff;
	padding: 4px 10px;
	line-height: 1.35;
}

.sitestaffr-cycle-picker[open] .sitestaffr-cycle-current-link {
	border-color: #2271b1;
	color: #135e96;
}

.sitestaffr-cycle-current-link::-webkit-details-marker {
	display: none;
}

.sitestaffr-cycle-list {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	background: #fff;
	border: 1px solid #c3c4c7;
	min-width: 300px;
	max-height: 280px;
	overflow-y: auto;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	padding: 6px 0;
	z-index: 20;
}

.sitestaffr-cycle-option {
	display: block;
	padding: 8px 12px;
	font-size: 13px;
	color: #1d2327;
	text-decoration: none;
}

.sitestaffr-cycle-option:hover,
.sitestaffr-cycle-option:focus {
	background: #f6f7f7;
	color: #135e96;
}

.sitestaffr-cycle-option.is-active {
	background: #eaf4ff;
	color: #135e96;
	font-weight: 600;
}

.sitestaffr-usage-dashboard.is-cycle-loading {
	opacity: 0.7;
	pointer-events: none;
}

.sitestaffr-channel-filters,
.sitestaffr-metric-filters {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.sitestaffr-filter-pill {
	border: 1px solid #c0d3ed;
	background: #fff;
	color: #2d4f7b;
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}

.sitestaffr-filter-pill:hover,
.sitestaffr-filter-pill:focus {
	border-color: #2271b1;
	color: #1f4f87;
}

.sitestaffr-filter-pill.is-active {
	background: #00838F;
	border-color: #00838F;
	color: #fff;
}

.sitestaffr-filter-content {
	position: relative;
	min-width: 0;
	overflow-x: auto;
}

.sitestaffr-filter-content.is-loading {
	opacity: 0.55;
	pointer-events: none;
}

.sitestaffr-filter-content.is-loading::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.48);
	z-index: 3;
}

.sitestaffr-filter-content.is-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 22px;
	height: 22px;
	margin: -11px 0 0 -11px;
	border: 3px solid #c6d9f3;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: sitestaffr-filter-spin 0.75s linear infinite;
	z-index: 4;
}

@keyframes sitestaffr-filter-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* ====================================
   Billing Cycle Summary Strip
   ==================================== */

.sitestaffr-cycle-summary-strip {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	margin-top: 2px;
}

.sitestaffr-cycle-metric {
	min-height: 92px;
	border: 1px solid #e8e2d8;
	border-radius: 12px;
	background: #fff;
	padding: 12px 14px;
	display: grid;
	align-content: start;
	gap: 6px;
	transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.sitestaffr-cycle-metric-label {
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 0.08em;
	font-weight: 700;
	color: #607786;
}

.sitestaffr-cycle-metric-value {
	font-size: 34px;
	line-height: 1;
	font-weight: 700;
	color: #00838F;
}

.sitestaffr-cycle-metric-meta {
	font-size: 13px;
	color: #4c6371;
	font-weight: 600;
}

.sitestaffr-cycle-metric:hover,
.sitestaffr-cycle-metric:focus-within {
	background: linear-gradient(135deg, #00838F 0%, #0a666d 100%);
	border-color: transparent;
	box-shadow: 0 10px 22px rgba(10, 102, 109, 0.18);
	transform: translateY(-1px);
}

.sitestaffr-cycle-metric:hover .sitestaffr-cycle-metric-label,
.sitestaffr-cycle-metric:focus-within .sitestaffr-cycle-metric-label {
	color: rgba(255, 255, 255, 0.82);
}

.sitestaffr-cycle-metric:hover .sitestaffr-cycle-metric-value,
.sitestaffr-cycle-metric:focus-within .sitestaffr-cycle-metric-value {
	color: #fff;
}

.sitestaffr-cycle-metric:hover .sitestaffr-cycle-metric-meta,
.sitestaffr-cycle-metric:focus-within .sitestaffr-cycle-metric-meta {
	color: rgba(255, 255, 255, 0.9);
}

.sitestaffr-cycle-chip-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
}

.sitestaffr-cycle-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	border: 1px solid #c7e8e1;
	background: #eaf7f4;
	color: #1f5f64;
	border-radius: 999px;
	padding: 6px 11px;
	font-size: 12px;
	font-weight: 600;
}

.sitestaffr-cycle-chip strong {
	font-weight: 700;
}

/* ====================================
   Statistics Box
   ==================================== */

.sitestaffr-stats-box {
	background: #f8f9fa;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	padding: 15px 20px;
}

.sitestaffr-stat-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid #e0e0e0;
}

.sitestaffr-stat-row:last-child {
	border-bottom: none;
}

.sitestaffr-stat-label {
	font-size: 14px;
	color: #666;
}

.sitestaffr-stat-value {
	font-size: 14px;
	font-weight: 600;
	color: #333;
}

.sitestaffr-stat-value--alert {
	color: #d63638;
	font-weight: 700;
}

.sitestaffr-chart-panel {
	padding: 18px;
}

.sitestaffr-chart-svg {
	width: 100%;
	height: auto;
	display: block;
	/* The axis/value <text> nodes are selectable, so the chart otherwise reads
	   as an I-beam. Arrow over the plot, pointer on the markers that carry a
	   tooltip. */
	cursor: default;
	user-select: none;
}

.sitestaffr-chart-svg circle {
	cursor: pointer;
}

.sitestaffr-chart-range {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	color: #6b7280;
	font-size: 12px;
}

/* Recent Conversations table — rounded corners to match chart panel */
.sitestaffr-usage-recent-table {
	border-radius: 8px;
	overflow: hidden;
	border-collapse: separate;
	border-spacing: 0;
	min-width: 640px;
}

.sitestaffr-chart-empty {
	margin: 0;
	color: #646970;
}

/* ====================================
   Plan & Billing (Consolidated)
   ==================================== */

.sitestaffr-plan-billing-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.sitestaffr-plan-card,
.sitestaffr-plan-actions-card {
	background: #f8fbff;
	border: 1px solid #c3d9f5;
	border-radius: 8px;
	padding: 18px;
}

.sitestaffr-plan-card {
	background: #e9f3ff;
	border-color: #a8c7ea;
}

.sitestaffr-plan-actions-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.sitestaffr-actions-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.sitestaffr-plan-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.sitestaffr-plan-card h3,
.sitestaffr-plan-actions-card h3 {
	margin: 0;
	font-size: 14px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #1d2327;
	line-height: 1.2;
}

.sitestaffr-plan-card h3 .dashicons,
.sitestaffr-plan-actions-card h3 .dashicons {
	font-size: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	line-height: 16px;
	color: #00838f;
	margin-top: 0;
}

.sitestaffr-billing-note {
	color: #50575e;
	font-size: 13px;
	margin: 6px 0 12px;
}

.sitestaffr-billing-note-manage-form {
	margin: 6px 0 12px;
}

.sitestaffr-billing-note-manage-form .sitestaffr-button-manage-subscription {
	font-size: 13px;
}

.sitestaffr-plan-status-pill {
	font-size: 12px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	line-height: 1.2;
	background-color: var(--sitestaffr-status-bg, rgba(76, 175, 80, 0.16));
	color: var(--sitestaffr-status-text, #4caf50);
}

.sitestaffr-plan-card-title {
	font-size: 20px;
	font-weight: 800;
	color: #0f2851;
	margin-bottom: 6px;
}

.sitestaffr-plan-cycle {
	font-size: 13px;
	color: #4b5b72;
	margin-bottom: 14px;
}

.sitestaffr-plan-meta {
	background: #ffffff;
	border: 1px solid #d8e3f2;
	border-radius: 8px;
}

.sitestaffr-plan-meta-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 11px 12px;
	border-bottom: 1px solid #e5edf8;
	font-size: 14px;
	color: #31445f;
}

.sitestaffr-plan-meta-row:last-child {
	border-bottom: none;
}

.sitestaffr-upgrade-cards-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: auto 0 0;
	flex: 1 1 auto;
	grid-auto-rows: 1fr;
	align-content: end;
}

.sitestaffr-upgrade-plan-form {
	margin: 0;
	display: flex;
}

.sitestaffr-upgrade-plan-card {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	width: 100%;
	height: 100%;
	text-align: left;
	background: #ffffff;
	border: 1px solid #c6d9f3;
	border-radius: 8px;
	padding: 12px;
	cursor: pointer;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.sitestaffr-upgrade-plan-card--starter {
	background: linear-gradient(160deg, #eff6ff 0%, #dbeafe 100%);
	border-color: #93c5fd;
}

.sitestaffr-upgrade-plan-card--business {
	background: linear-gradient(160deg, #ecfdf5 0%, #d1fae5 100%);
	border-color: #6ee7b7;
}

.sitestaffr-upgrade-plan-card--pro {
	background: linear-gradient(160deg, #dcfce7 0%, #86efac 100%);
	border-color: #22c55e;
}

.sitestaffr-upgrade-plan-card:hover,
.sitestaffr-upgrade-plan-card:focus {
	border-color: #2271b1;
	box-shadow: 0 6px 16px rgba(34, 113, 177, 0.16);
	transform: translateY(-1px);
}

.sitestaffr-upgrade-plan-name {
	display: block;
	font-weight: 700;
	font-size: 16px;
	color: #10305a;
	margin-bottom: 0;
}

.sitestaffr-upgrade-plan-icon {
	display: inline-block;
	font-size: 16px;
	line-height: 1;
	margin-bottom: 6px;
	color: #135e96;
}

.sitestaffr-upgrade-plan-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 4px;
}

.sitestaffr-upgrade-plan-price {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: #0b3a66;
	margin-bottom: 0;
	white-space: nowrap;
}

.sitestaffr-upgrade-plan-minutes {
	display: block;
	font-size: 13px;
	color: #3f5674;
	font-weight: 600;
}

.sitestaffr-upgrade-plan-features {
	margin: 8px 0 0;
	padding-left: 0;
	list-style: none;
	color: #2b4966;
	font-size: 12px;
	line-height: 1.45;
}

.sitestaffr-upgrade-plan-features li {
	margin: 0 0 4px;
	position: relative;
	padding-left: 12px;
}

.sitestaffr-upgrade-plan-features li::before {
	content: "-";
	position: absolute;
	left: 0;
	top: 0;
	color: #395a79;
	font-weight: 700;
}

.sitestaffr-upgrade-plan-features li:last-child {
	margin-bottom: 0;
}

.sitestaffr-no-upgrade {
	background: #fff;
	border: 1px dashed #b9cbe2;
	border-radius: 8px;
	padding: 12px;
	color: #3f5674;
	font-size: 13px;
	margin: 10px 0 16px;
}

.sitestaffr-actions-footer {
	margin-top: auto;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.sitestaffr-actions-footer form {
	margin: 0;
}

.sitestaffr-actions-footer .button {
	min-width: 160px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.sitestaffr-button-buy-more {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	background: #3f8f3f !important;
	border-color: #3f8f3f !important;
	color: #fff !important;
}

.sitestaffr-button-buy-more:hover,
.sitestaffr-button-buy-more:focus {
	background: #2f7a2f !important;
	border-color: #2f7a2f !important;
	color: #fff !important;
}

.sitestaffr-plan-meta-row-cta {
	display: block;
}

.sitestaffr-plan-meta-row-cta form {
	margin: 0;
}

.sitestaffr-plan-meta-row-cta .sitestaffr-starter-cta-button {
	width: 100%;
	justify-content: center;
	margin-bottom: 0;
}

.sitestaffr-button-manage-subscription {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	color: #2271b1 !important;
	min-width: auto !important;
	padding: 0 !important;
	height: auto !important;
	line-height: 1.4 !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px;
}

.sitestaffr-button-manage-subscription:hover,
.sitestaffr-button-manage-subscription:focus {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	color: #135e96 !important;
	text-decoration: none !important;
}

.sitestaffr-button-manage-subscription:hover .sitestaffr-button-label,
.sitestaffr-button-manage-subscription:focus .sitestaffr-button-label {
	text-decoration: underline !important;
}

.sitestaffr-button-manage-subscription .dashicons,
.sitestaffr-button-buy-more .dashicons {
	font-size: 16px;
	line-height: 1;
	width: 16px;
	height: 16px;
	margin-top: 0;
}

.sitestaffr-billing-select {
	display: block;
	width: 100%;
	margin-bottom: 10px;
}

/* ====================================
   Minute Balance Widget (Dashboard)
   ==================================== */

.sitestaffr-minute-balance-widget {
	grid-column: span 1;
}

.sitestaffr-balance-content {
	padding: 15px;
}

.sitestaffr-balance-breakdown {
	margin-bottom: 15px;
}

.sitestaffr-balance-item {
	display: flex;
	align-items: center;
	margin-bottom: 12px;
	font-size: 14px;
}

.sitestaffr-balance-bullet {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-right: 10px;
	flex-shrink: 0;
}

.sitestaffr-balance-label {
	font-weight: 500;
	margin-right: 8px;
	color: #666;
}

.sitestaffr-balance-value {
	font-weight: 600;
	color: #333;
}

.sitestaffr-balance-total-text {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 10px;
}

.sitestaffr-balance-action {
	margin-top: 15px;
}

.sitestaffr-balance-action .button {
	width: 100%;
	justify-content: center;
}

/* Color States for Balance Widget */
.sitestaffr-balance-good {
	border-left: 4px solid #4caf50;
}

.sitestaffr-balance-warning {
	border-left: 4px solid #ff9800;
}

.sitestaffr-balance-critical {
	border-left: 4px solid #f44336;
}

/* ====================================
   Empty States
   ==================================== */

.sitestaffr-empty-state {
	text-align: center;
	padding: 40px 20px;
	color: #666;
	font-style: italic;
}

/* ====================================
   Responsive Design
   ==================================== */

@media screen and (max-width: 1024px) {
	.sitestaffr-section-header-with-filters,
	.sitestaffr-section-header-with-actions {
		height: auto;
		min-height: 60px;
		align-items: flex-start;
		padding-top: 12px;
		padding-bottom: 12px;
	}

	.sitestaffr-cycle-controls,
	.sitestaffr-channel-filters {
		width: 100%;
		flex-wrap: wrap;
	}
}

@media screen and (max-width: 1100px) {
	.sitestaffr-cycle-summary-strip {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media screen and (max-width: 782px) {
	.sitestaffr-cycle-summary-strip {
		grid-template-columns: 1fr;
	}

	.sitestaffr-stat-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 5px;
	}

	.sitestaffr-stat-value {
		font-size: 16px;
	}

	.sitestaffr-balance-total-text {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.sitestaffr-cycle-metric-value {
		font-size: 30px;
	}

	.sitestaffr-plan-billing-grid {
		grid-template-columns: 1fr;
	}

	.sitestaffr-section-header-with-filters {
		flex-direction: column;
		align-items: flex-start;
		height: auto;
		min-height: 50px;
		padding: 12px 18px;
		gap: 8px;
	}

	.sitestaffr-section-header-with-filters .sitestaffr-filter-pills {
		flex-wrap: wrap;
		gap: 6px;
	}

	.sitestaffr-section-header-with-actions {
		flex-direction: column;
		align-items: flex-start;
		height: auto;
		min-height: 50px;
		padding: 12px 18px;
		gap: 8px;
	}

	.sitestaffr-cycle-controls {
		width: 100%;
	}

	.sitestaffr-cycle-picker {
		flex: 1;
	}

	.sitestaffr-cycle-list {
		left: 0;
		right: auto;
		min-width: min(100%, 320px);
	}

	.sitestaffr-upgrade-cards-grid {
		grid-template-columns: 1fr;
	}

	.sitestaffr-actions-header {
		flex-wrap: wrap;
	}

	.sitestaffr-actions-header form {
		width: 100%;
	}

	.sitestaffr-actions-header .sitestaffr-button-buy-more {
		width: 100%;
		justify-content: center;
	}

	.sitestaffr-plan-card-title {
		font-size: 18px;
	}

	/* Recent Conversations table → card layout on mobile */
	.sitestaffr-filter-content {
		overflow-x: visible;
	}

	.sitestaffr-usage-recent-table {
		min-width: 0 !important;
		width: 100% !important;
		display: block !important;
	}

	.sitestaffr-usage-recent-table thead {
		display: none !important;
	}

	.sitestaffr-usage-recent-table tbody {
		display: block !important;
	}

	.sitestaffr-usage-recent-table tbody tr {
		display: block !important;
		background: #fff;
		border: 1px solid #e8e2d8;
		border-radius: 8px;
		padding: 12px 14px;
		margin-bottom: 8px;
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	}

	.sitestaffr-usage-recent-table tbody tr:last-child {
		margin-bottom: 0;
	}

	/* Disable WP striping on cards */
	.sitestaffr-usage-recent-table tbody tr.alternate {
		background: #fff !important;
	}

	/* Override WP core hiding non-primary columns */
	.sitestaffr-usage-recent-table tr:not(.inline-edit-row):not(.no-items) td {
		display: block !important;
		position: static !important;
		padding: 0 !important;
		margin-bottom: 8px !important;
		border: none !important;
		width: auto !important;
		text-align: left !important;
		float: none !important;
		clear: none !important;
		background: transparent !important;
	}

	.sitestaffr-usage-recent-table tr:not(.inline-edit-row):not(.no-items) td:last-child {
		margin-bottom: 0 !important;
	}

	/* Override WP core absolute-positioned ::before */
	.sitestaffr-usage-recent-table tr:not(.inline-edit-row):not(.no-items) td::before {
		content: attr(data-colname) !important;
		display: block !important;
		position: static !important;
		left: auto !important;
		float: none !important;
		width: auto !important;
		max-width: none !important;
		font-size: 10px !important;
		font-weight: 600 !important;
		color: #8c8f94 !important;
		text-transform: uppercase !important;
		letter-spacing: 0.05em;
		margin-bottom: 1px;
		padding: 0 !important;
		text-align: left !important;
		overflow: visible !important;
		white-space: normal !important;
		text-overflow: clip !important;
	}

	/* Remove WP's 50px right padding on primary column */
	.sitestaffr-usage-recent-table td.column-primary {
		padding-right: 0 !important;
	}

	/* Session ID link: full width on mobile */
	.sitestaffr-usage-recent-table .sitestaffr-call-sid-link {
		display: block;
		width: 100%;
		max-width: none;
		box-sizing: border-box;
		text-align: center;
		white-space: normal;
		word-break: break-all;
	}

	/* Grid layout: Session spans full row, Date/Channel/Duration side-by-side */
	.sitestaffr-usage-recent-table tbody tr {
		display: grid !important;
		grid-template-columns: 1fr 1fr 1fr;
		gap: 0 10px;
	}

	/* Session ID (1st td) spans full width */
	.sitestaffr-usage-recent-table tr:not(.inline-edit-row):not(.no-items) td:first-child {
		grid-column: 1 / -1;
	}

	/* Date, Channel, Duration (2nd/3rd/4th td) — one column each */
	.sitestaffr-usage-recent-table tr:not(.inline-edit-row):not(.no-items) td:nth-child(2),
	.sitestaffr-usage-recent-table tr:not(.inline-edit-row):not(.no-items) td:nth-child(3),
	.sitestaffr-usage-recent-table tr:not(.inline-edit-row):not(.no-items) td:nth-child(4) {
		grid-column: span 1;
		margin-bottom: 0 !important;
		text-align: center !important;
	}

	/* Center the ::before labels too */
	.sitestaffr-usage-recent-table tr:not(.inline-edit-row):not(.no-items) td:nth-child(2)::before,
	.sitestaffr-usage-recent-table tr:not(.inline-edit-row):not(.no-items) td:nth-child(3)::before,
	.sitestaffr-usage-recent-table tr:not(.inline-edit-row):not(.no-items) td:nth-child(4)::before {
		text-align: center !important;
	}
}

@media screen and (max-width: 600px) {
	.sitestaffr-usage-dashboard {
		margin: 0 auto;
	}

	.sitestaffr-usage-section {
		padding: 15px;
	}

	.sitestaffr-cycle-metric {
		padding: 15px;
	}

	.sitestaffr-cycle-metric-value {
		font-size: 28px;
	}
}

/* ====================================
   Upgrade Plan Modal
   ==================================== */

.sitestaffr-upgrade-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	gap: 14px;
	color: #646970;
	font-size: 14px;
}

.sitestaffr-upgrade-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid #e0e0e0;
	border-top-color: #00838F;
	border-radius: 50%;
	animation: sitestaffr-filter-spin 0.75s linear infinite;
}

.sitestaffr-upgrade-spinner-small {
	width: 18px;
	height: 18px;
	border-width: 2px;
	display: inline-block;
	vertical-align: middle;
}

.sitestaffr-upgrade-error {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 16px 18px;
	background: #fef2f2;
	border: 1px solid #fca5a5;
	border-radius: 8px;
	color: #991b1b;
	font-size: 14px;
}

.sitestaffr-upgrade-error .dashicons {
	color: #dc2626;
	font-size: 20px;
	width: 20px;
	height: 20px;
	line-height: 20px;
	flex-shrink: 0;
	margin-top: 1px;
}

.sitestaffr-upgrade-error p {
	margin: 0;
}

.sitestaffr-upgrade-plan-comparison {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-bottom: 20px;
	padding: 16px;
	background: #f0f6ff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.sitestaffr-upgrade-from,
.sitestaffr-upgrade-to {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.sitestaffr-upgrade-direction {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #6b7280;
}

.sitestaffr-upgrade-from strong,
.sitestaffr-upgrade-to strong {
	font-size: 16px;
	color: #1d2327;
	transition: color 0.2s ease;
}

.sitestaffr-upgrade-arrow {
	color: #9ca3af;
	font-size: 24px;
	width: 24px;
	height: 24px;
	line-height: 24px;
	transition: color 0.2s ease;
}

.sitestaffr-upgrade-summary {
	background: linear-gradient(135deg, #00838F 0%, #006064 100%);
	border-radius: 8px;
	padding: 2px 0;
	margin-bottom: 16px;
}

.sitestaffr-upgrade-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 18px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
	color: rgba(255, 255, 255, 0.9);
	font-size: 14px;
}

.sitestaffr-upgrade-summary-row:last-child {
	border-bottom: none;
}

.sitestaffr-upgrade-summary-row strong {
	color: #fff;
	font-size: 16px;
	font-weight: 700;
}

.sitestaffr-upgrade-details {
	background: #f8fafb;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
}

.sitestaffr-upgrade-detail-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid #e2e8f0;
}

.sitestaffr-upgrade-detail-item:last-child {
	border-bottom: none;
}

.sitestaffr-upgrade-detail-icon {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	line-height: 32px;
	font-size: 16px;
	text-align: center;
	border-radius: 6px;
	background: #ecfdf5;
	color: #059669;
}

.sitestaffr-upgrade-detail-content {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.sitestaffr-upgrade-detail-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: #6b7280;
}

.sitestaffr-upgrade-detail-value {
	font-size: 13px;
	color: #1d2327;
	line-height: 1.4;
}

#sitestaffr-upgrade-cycle-note .sitestaffr-upgrade-detail-icon {
	background: #eff6ff;
	color: #2563eb;
}

.sitestaffr-upgrade-carryover-item .sitestaffr-upgrade-detail-icon {
	background: #faf5ff;
	color: #7c3aed;
}

.sitestaffr-upgrade-confirm-btn {
	background: #3f8f3f !important;
	border-color: #3f8f3f !important;
	color: #fff !important;
	min-width: 160px;
	justify-content: center;
}

.sitestaffr-upgrade-confirm-btn:hover,
.sitestaffr-upgrade-confirm-btn:focus {
	background: #2f7a2f !important;
	border-color: #2f7a2f !important;
	color: #fff !important;
}

.sitestaffr-upgrade-confirm-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.sitestaffr-upgrade-confirm-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 16px;
}

.sitestaffr-upgrade-processing-footer {
	justify-content: center !important;
}

.sitestaffr-upgrade-processing-text {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	color: #646970;
	font-weight: 600;
}

#sitestaffr-upgrade-modal .sitestaffr-modal-header h2 .dashicons {
	color: #00838F;
}

@media screen and (max-width: 600px) {
	.sitestaffr-upgrade-plan-comparison {
		flex-direction: column;
		gap: 8px;
	}

	.sitestaffr-upgrade-arrow {
		transform: rotate(90deg);
	}
}

/* ====================================
   Downgrade Plan Modal
   ==================================== */

.sitestaffr-downgrade-modal-header h2 .dashicons {
	color: #B45309 !important;
}

.sitestaffr-downgrade-info-box {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 14px 16px;
	background: #fffbeb;
	border: 1px solid #fbbf24;
	border-radius: 8px;
	font-size: 14px;
	color: #92400e;
	margin-bottom: 20px;
}

.sitestaffr-downgrade-info-box .dashicons {
	color: #d97706;
	font-size: 20px;
	width: 20px;
	height: 20px;
	line-height: 20px;
	flex-shrink: 0;
	margin-top: 1px;
}

.sitestaffr-downgrade-info-box p {
	margin: 0;
	line-height: 1.5;
}

.sitestaffr-downgrade-plan-comparison {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-bottom: 20px;
	padding: 16px;
	background: #f8fafb;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.sitestaffr-downgrade-from,
.sitestaffr-downgrade-to {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.sitestaffr-downgrade-direction {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #6b7280;
}

.sitestaffr-downgrade-from strong,
.sitestaffr-downgrade-to strong {
	font-size: 16px;
	color: #1d2327;
	transition: color 0.2s ease;
}

.sitestaffr-downgrade-minutes {
	font-size: 13px;
	color: #6b7280;
	font-weight: 600;
}

.sitestaffr-downgrade-arrow {
	color: #9ca3af;
	font-size: 24px;
	width: 24px;
	height: 24px;
	line-height: 24px;
	transition: color 0.2s ease;
}

.sitestaffr-downgrade-details {
	display: flex;
	flex-direction: column;
	gap: 0;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
}

.sitestaffr-downgrade-detail-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	font-size: 14px;
	color: #374151;
	border-bottom: 1px solid #f3f4f6;
}

.sitestaffr-downgrade-detail-row:last-child {
	border-bottom: none;
}

.sitestaffr-downgrade-detail-row .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	line-height: 18px;
	flex-shrink: 0;
}

.sitestaffr-downgrade-detail-row .dashicons-calendar-alt {
	color: #2271b1;
}

.sitestaffr-downgrade-detail-row .dashicons-yes-alt {
	color: #059669;
}

.sitestaffr-downgrade-detail-row--warning {
	background: #fffbeb;
}

.sitestaffr-downgrade-detail-row--warning .dashicons {
	color: #d97706;
}

.sitestaffr-downgrade-portal-btn {
	background: #B45309 !important;
	border-color: #B45309 !important;
	color: #fff !important;
	min-width: 200px;
	justify-content: center;
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
}

.sitestaffr-downgrade-portal-btn:hover,
.sitestaffr-downgrade-portal-btn:focus {
	background: #92400e !important;
	border-color: #92400e !important;
	color: #fff !important;
}

.sitestaffr-downgrade-portal-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 16px;
}

@media screen and (max-width: 600px) {
	.sitestaffr-downgrade-plan-comparison {
		flex-direction: column;
		gap: 8px;
	}

	.sitestaffr-downgrade-arrow {
		transform: rotate(90deg);
	}

	.sitestaffr-downgrade-portal-btn {
		width: 100%;
	}
}

/* ==========================================================================
   PACE CHIP (burn rate) + report actions (spec 7)
   ========================================================================== */

/* Pace is a status, not a metric — it sits with the cycle facts so the four
   tiles stay the same height and "minutes used" isn't stated twice. */
.sitestaffr-cycle-chip--pace.is-on-track {
	border-color: #bfe8d6;
	background: #eefaf4;
	color: #17694a;
}

.sitestaffr-cycle-chip--pace.is-will-run-short {
	border-color: #f0c2c3;
	background: #fdf1f1;
	color: #8a2424;
}

.sitestaffr-burn-cta {
	margin-left: 2px;
}

.sitestaffr-cycle-chip-actions {
	display: inline-flex;
	gap: 6px;
	margin-left: auto;
}

.sitestaffr-cycle-chip-actions .button {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.sitestaffr-cycle-chip-actions .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	line-height: 1.7;
}

.sitestaffr-metric-filters {
	margin-right: 10px;
}

@media screen and (max-width: 782px) {
	.sitestaffr-cycle-chip-actions {
		margin-left: 0;
		flex-basis: 100%;
	}
}

/* ==========================================================================
   PRINT — the Print / Download button prints this page directly, so hide the
   controls and keep the cycle summary, chart and tables intact.
   ========================================================================== */

/* When & where conversations happen */
.sitestaffr-coverage-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	gap: 24px;
	align-items: start;
}

.sitestaffr-coverage-panel h3 {
	margin: 0 0 8px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b7280;
}

.sitestaffr-coverage-figure {
	margin: 0 0 4px;
	font-size: 40px;
	font-weight: 700;
	line-height: 1.1;
	color: #00838F;
}

.sitestaffr-coverage-sub {
	margin: 0;
	color: #4b5563;
}

.sitestaffr-coverage-empty p {
	margin: 0 0 12px;
	color: #4b5563;
}

.sitestaffr-pages-table {
	width: 100%;
	border-collapse: collapse;
}

.sitestaffr-pages-table th,
.sitestaffr-pages-table td {
	padding: 8px 10px;
	text-align: left;
	border-bottom: 1px solid #e5e7eb;
}

.sitestaffr-pages-table th:nth-child(n+2),
.sitestaffr-pages-table td:nth-child(n+2) {
	width: 1%;
	white-space: nowrap;
	text-align: right;
}

.sitestaffr-pages-table td:first-child {
	max-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sitestaffr-pages-unknown td {
	color: #6b7280;
	font-style: italic;
}

@media screen and (max-width: 782px) {
	.sitestaffr-coverage-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}
