/**
 * POM AI account management components layered on the shared licensing cards.
 */

.pom-ai-section-card {
	margin-bottom: 20px;
}

.pom-ai-credit-hero {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 18px;
	padding: 16px 18px;
	border: 1px solid #dfe4ea;
	border-radius: 8px;
	background: #f8f9fb;
}

.pom-ai-credit-hero p {
	max-width: 620px;
	margin: 0;
	color: #475467;
}

.pom-ai-credit-hero .pom-lic-credits-figure {
	margin: 3px 0 0;
	white-space: nowrap;
}

.pom-ai-credit-sources {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
	gap: 14px;
}

.pom-ai-credit-source {
	min-width: 0;
	border: 1px solid #e3e5e8;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}

.pom-ai-credit-source__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	border-bottom: 1px solid #eceef1;
	background: #f8f9fb;
}

.pom-ai-credit-source__header h4 {
	margin: 0;
	font-size: 0.98em;
}

.pom-ai-credit-source__header > strong {
	color: #101828;
	font-size: 1.15em;
}

.pom-ai-credit-batches {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pom-ai-credit-batches li {
	display: grid;
	gap: 3px;
	margin: 0;
	padding: 12px 14px;
}

.pom-ai-credit-batches li + li {
	border-top: 1px solid #eceef1;
}

.pom-ai-credit-batches li > strong {
	color: #101828;
}

.pom-ai-credit-batches li > span {
	color: #667085;
	font-size: 0.86em;
}

.pom-ai-section-intro {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 18px;
}

.pom-ai-section-intro p {
	margin: 0;
	color: #475467;
}

.pom-ai-section-intro .pom-lic-btn {
	flex: 0 0 auto;
}

.pom-ai-inline-notice {
	margin: 12px 0;
	padding: 10px 12px;
	border: 1px solid #d1e0ff;
	border-radius: 7px;
	background: #eef4ff;
	color: #1d3f8f;
}

.pom-ai-inline-notice:empty {
	display: none;
}

.pom-ai-inline-notice.web-n-error {
	border-color: #f5c6c8;
	background: #fdebec;
	color: #8f2420;
}

.pom-ai-inline-notice.web-n-success {
	border-color: #b7dfc4;
	background: #e7f6ec;
	color: #137a33;
}

.pom-ai-domain-form-panel {
	margin: 0 0 20px;
	padding: 16px;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	background: #f8f9fb;
}

.pom-ai-domain-form-panel h4 {
	margin: 0 0 12px;
}

.pom-ai-domain-add-form {
	display: grid;
	grid-template-columns: minmax(220px, 1fr) auto;
	align-items: end;
	gap: 12px;
}

.pom-ai-domain-add-form label,
.pom-ai-domain-limit-form label {
	display: grid;
	gap: 5px;
	min-width: 0;
	margin: 0;
	color: #344054;
	font-size: 0.86em;
	font-weight: 600;
}

.pom-ai-domain-add-form input,
.pom-ai-domain-limit-form input {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	min-height: 38px;
	margin: 0;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	background: #fff;
	padding: 7px 10px;
}

.pom-ai-subsection-title {
	margin: 24px 0 14px;
}

#domain-list.pom-ai-domain-grid {
	display: grid;
	grid-template-columns: 100%;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#domain-list .pom-ai-domain-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 1px solid #e3e5e8;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}

.pom-ai-domain-card__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	border-bottom: 1px solid #eceef1;
	background: #f8f9fb;
}

.pom-ai-domain-card__header strong {
	min-width: 0;
	color: #101828;
	word-break: break-word;
}

.pom-ai-domain-meta {
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
	margin: 0;
	padding: 14px;
}

.pom-ai-domain-meta .pom-lic-meta__value {
	font-size: 0.9em;
}

.pom-ai-inline-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.domain-limit-actions {
	margin: auto 14px 14px;
}

.pom-ai-domain-limit-form {
	display: grid;
	gap: 10px;
	margin: 0 14px 14px;
	padding: 12px;
	border: 1px solid #d0d5dd;
	border-radius: 7px;
	background: #f8f9fb;
}

.pom-ai-domain-card__footer {
	display: flex;
	justify-content: flex-end;
	padding: 12px 14px;
	border-top: 1px solid #eceef1;
	background: #fbfcfd;
}

.pom-ai-domain-card > .credits-message {
	margin: 0 14px 14px;
}

.pom-ai-empty-state {
	margin: 0;
	padding: 18px;
	border: 1px dashed #d0d5dd;
	border-radius: 8px;
	background: #f8f9fb;
	color: #667085;
}

.pom-ai-credit-source > .pom-ai-empty-state {
	border: 0;
	border-radius: 0;
}

.pom-ai-table-scroll {
	overflow-x: auto;
	border: 1px solid #e3e5e8;
	border-radius: 8px;
}

.pom-ai-usage-logs {
	width: 100%;
	min-width: 620px;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	background: #fff;
}

.pom-ai-usage-logs th,
.pom-ai-usage-logs td {
	padding: 10px 12px;
	border-bottom: 1px solid #eceef1;
	text-align: left;
	vertical-align: top;
}

.pom-ai-usage-logs th {
	background: #f8f9fb;
	color: #667085;
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.pom-ai-usage-logs tbody tr:last-child td {
	border-bottom: 0;
}

.pom-ai-usage-logs td:nth-child(2) {
	word-break: break-word;
}

.pom-ai-usage-logs code {
	background: #f2f4f7;
	color: #344054;
	font-size: 0.84em;
	word-break: break-word;
}

.pom-ai-usage-logs .align-right {
	text-align: right;
}

.pom-ai-usage-logs-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 16px;
}

.pom-ai-usage-logs-pagination .pom-lic-btn {
	text-decoration: none;
}

@media (max-width: 640px) {
	.pom-ai-credit-hero,
	.pom-ai-section-intro {
		align-items: flex-start;
		flex-direction: column;
	}

	.pom-ai-domain-add-form {
		grid-template-columns: minmax(0, 1fr);
	}

	.pom-ai-domain-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}
