/* TP License Manager — front-end styles */

.tplm-sites-section {
	margin: 2em 0;
	padding: 1.5em;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	background: #fafafa;
}
.tplm-sites-section h2 { margin-top: 0; }
.tplm-site-fields { margin-bottom: 1.5em; }
.tplm-site-fields h3 { margin-bottom: 0.25em; }
.tplm-hint { color: #666; font-size: 0.9em; }
.tplm-site-row {
	border-top: 1px dashed #ddd;
	padding-top: 1em;
	margin-top: 1em;
}
.tplm-site-row:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.tplm-remove-row { color: #b32d2e; }

.tplm-licenses-table { width: 100%; }
.tplm-licenses-table code { word-break: break-all; }

.tplm-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.8;
	background: #e5e7eb;
	color: #374151;
	white-space: nowrap;
}
.tplm-status-active   { background: #dcfce7; color: #166534; }
.tplm-status-pending  { background: #fef3c7; color: #92400e; }
.tplm-status-expired  { background: #fee2e2; color: #991b1b; }
.tplm-status-suspended{ background: #e5e7eb; color: #4b5563; }
.tplm-days-green { background: #dcfce7; color: #166534; }
.tplm-days-amber { background: #fef3c7; color: #92400e; }
.tplm-days-red   { background: #fee2e2; color: #991b1b; }

/* Toggle switch */
.tplm-switch { position: relative; display: inline-block; width: 44px; height: 24px; vertical-align: middle; }
.tplm-switch input { opacity: 0; width: 0; height: 0; }
.tplm-slider {
	position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
	background-color: #ccc; transition: .3s; border-radius: 24px;
}
.tplm-slider:before {
	position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
	background-color: #fff; transition: .3s; border-radius: 50%;
}
.tplm-switch input:checked + .tplm-slider { background-color: #2271b1; }
.tplm-switch input:checked + .tplm-slider:before { transform: translateX(20px); }
.tplm-toggle-label { margin-left: 6px; font-size: 0.9em; }

.tplm-revealed { display: inline-block; margin-left: 6px; word-break: break-all; font-size: 0.9em; }
.tplm-note { color: #666; font-size: 0.9em; margin-top: 1em; }
.tplm-login-required { padding: 1em; background: #fff8e1; border: 1px solid #ffe082; border-radius: 6px; }

/* Pending license — client website-details form */
.tplm-submit-row td { background: #fffbeb; }
.tplm-site-form {
	max-width: 560px;
	padding: 1em 1.25em;
	border: 1px dashed #d97706;
	border-radius: 8px;
	background: #fff;
}
.tplm-site-form .form-row { margin: 0.75em 0; }
.tplm-site-form .form-row label { display: block; font-weight: 600; margin-bottom: 4px; }
.tplm-site-form .input-text { width: 100%; }
.tplm-site-form .required { color: #b32d2e; }

/* My Licenses compact fit and pagination */
.tplm-licenses { overflow-x: auto; max-width: 100%; }
.tplm-licenses-table { width: 100%; table-layout: fixed; }
.tplm-licenses-table th, .tplm-licenses-table td { padding: 8px 10px; font-size: 14px; vertical-align: middle; }
.tplm-licenses-table th:nth-child(1), .tplm-licenses-table td:nth-child(1) { width: 17%; }
.tplm-licenses-table th:nth-child(2), .tplm-licenses-table td:nth-child(2) { width: 21%; overflow: hidden; }
.tplm-licenses-table th:nth-child(3), .tplm-licenses-table td:nth-child(3) { width: 12%; }
.tplm-licenses-table th:nth-child(4), .tplm-licenses-table td:nth-child(4) { width: 10%; }

.tplm-licenses-table th:nth-child(7), .tplm-licenses-table td:nth-child(7) { width: 9%; overflow: visible; white-space: nowrap; }
.tplm-licenses-table th:nth-child(8), .tplm-licenses-table td:nth-child(8) { width: 10%; }.tplm-licenses-table td:nth-child(2) a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tplm-licenses-table td:nth-child(8) { white-space: nowrap; }
.tplm-licenses-pagination { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.tplm-licenses-pagination a { display: inline-block; padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 6px; text-decoration: none; }
.tplm-licenses-pagination .tplm-page-current { display: inline-block; padding: 6px 12px; border: 1px solid #2271b1; border-radius: 6px; background: #2271b1; color: #fff; }
@media (max-width: 768px) { .tplm-licenses-table { table-layout: auto; min-width: 640px; } }

/* My Licenses fit, second pass: allow content area to shrink */
.woocommerce-MyAccount-content { min-width: 0; }
.tplm-licenses { min-width: 0; }
.tplm-licenses-table { max-width: 100%; }
.tplm-licenses-table th, .tplm-licenses-table td { box-sizing: border-box; padding: 6px 8px; font-size: 13px; }
.tplm-licenses-table th:nth-child(1), .tplm-licenses-table td:nth-child(1) { width: 16%; }
.tplm-licenses-table th:nth-child(2), .tplm-licenses-table td:nth-child(2) { width: 20%; }
.tplm-licenses-table th:nth-child(3), .tplm-licenses-table td:nth-child(3) { width: 11%; }
.tplm-licenses-table th:nth-child(4), .tplm-licenses-table td:nth-child(4) { width: 9%; }
.tplm-licenses-table th:nth-child(5), .tplm-licenses-table td:nth-child(5) { width: 11%; }
.tplm-licenses-table th:nth-child(6), .tplm-licenses-table td:nth-child(6) { width: 10%; }
.tplm-licenses-table th:nth-child(7), .tplm-licenses-table td:nth-child(7) { width: 10%; }
.tplm-licenses-table th:nth-child(8), .tplm-licenses-table td:nth-child(8) { width: 9%; }
/* My Licenses fit, third pass: force fixed layout over theme rules */
.tplm-licenses-table { width: 100% !important; table-layout: fixed !important; min-width: 0 !important; }
.tplm-licenses-table th, .tplm-licenses-table td { min-width: 0 !important; }
.tplm-licenses-table td:nth-child(3), .tplm-licenses-table td:nth-child(6) { white-space: normal; }
/* Hide Remove when only one site row remains. */
.tplm-site-rows > .tplm-site-row:only-child .tplm-remove-row { display: none; }