/* ═══════════════════════════════════════════
   AF App Presupuestos — History & Detail
   History table, detail view, pagination.
   Depende de: af-app-plugins, variables.css, _layout.css, _components.css
   ═══════════════════════════════════════════ */

/* ── History table ── */
.af-presupuestos-history-table-wrap {
	overflow-x: auto;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 0;
	background: #fff;
}

.af-presupuestos-history-table {
	width: 100%;
	border-collapse: collapse;
}

.af-presupuestos-history-table th {
	padding: 12px 14px;
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 0.05em;
	color: var(--af-gray-500, #718096);
	background: rgba(248, 250, 252, 0.8);
	border-bottom: 1px solid rgba(15, 23, 42, 0.08);
	text-align: left;
}

.af-presupuestos-history-table td {
	padding: 16px 14px !important;
	font-size: 14px;
	border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
	vertical-align: middle;
	white-space: nowrap;
}

.af-presupuestos-history-table tbody tr:hover {
	background: rgba(248, 250, 252, 0.6);
}

.af-presupuestos-actions-cell {
	display: flex;
	gap: 6px;
	flex-wrap: nowrap;
	align-items: center;
}

/* ── Detail view ── */
.af-presupuestos-detail__meta {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-bottom: clamp(16px, 2vw, 24px);
	flex-wrap: wrap;
}

.af-presupuestos-detail__parties {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin-bottom: clamp(16px, 2vw, 24px);
}

.af-presupuestos-detail__party-card {
	background: rgba(248, 250, 252, 0.9);
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 0;
	padding: 16px 18px;
}

.af-presupuestos-detail__parties h4,
.af-presupuestos-detail__party-card h4 {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--af-gray-500, #718096);
	margin: 0 0 8px 0;
}

.af-presupuestos-detail__party-card p {
	margin: 0;
	line-height: 1.6;
	font-size: 14px;
}

.af-presupuestos-detail__party-card strong {
	font-size: 15px;
}

.af-presupuestos-detail__lines {
	margin-bottom: clamp(16px, 2vw, 24px);
}

.af-presupuestos-detail__totals {
	max-width: 100%;
	margin-left: auto;
	margin-bottom: clamp(16px, 2vw, 24px);
	padding: 14px 16px;
	background: rgba(248, 250, 252, 0.9);
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 0;
}

.af-presupuestos-detail__notes {
	padding: 16px 18px;
	background: rgba(248, 250, 252, 0.9);
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 0;
	margin-bottom: clamp(16px, 2vw, 24px);
}

.af-presupuestos-detail__notes h4 {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--af-gray-500, #718096);
	margin: 0 0 8px 0;
}

.af-presupuestos-detail__actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* ── Pagination ── */
.af-presupuestos-pagination {
	display: flex;
	justify-content: center;
	gap: 4px;
	margin-top: 16px;
	flex-wrap: wrap;
}

.af-presupuestos-pagination__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	font-size: 14px;
	font-weight: 500;
	color: var(--af-gray-700, #374151);
	background: #fff;
	border: 1px solid var(--af-gray-300, #d1d5db);
	border-radius: 0;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s;
}

.af-presupuestos-pagination__link:hover {
	background: var(--af-gray-100, #f3f4f6);
	border-color: var(--af-gray-400, #9ca3af);
}

.af-presupuestos-pagination__link.is-active {
	background: var(--af-primary, #09aeb8);
	color: #fff;
	border-color: var(--af-primary, #09aeb8);
	pointer-events: none;
}
