/*
 * DadsFam Invoice Manager — the invoice list in My Account.
 *
 * Kept deliberately neutral so it sits well in any theme: it inherits the
 * theme's font and text colour, and only the accent colour (set under
 * Settings › Look) is the shop's own.
 */
.dfim-account {
	--dfim-accent: #0a66c2;
	--dfim-accent-dark: #08529c;
	--dfim-line: rgba(15, 23, 42, 0.1);
	--dfim-soft: rgba(15, 23, 42, 0.04);
	--dfim-muted: rgba(15, 23, 42, 0.62);
	margin: 0 0 2em;
}
.dfim-account *,
.dfim-account *::before,
.dfim-account *::after { box-sizing: border-box; }

.dfim-account-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dfim-account-title { margin: 0 !important; font-size: 1.35em; line-height: 1.25; }
.dfim-account-sub { margin: 4px 0 0 !important; color: var(--dfim-muted); font-size: 0.92em; }
.dfim-account-subhead { margin: 2em 0 0.8em; }

.dfim-account-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px 14px;
	padding: 14px 16px;
	margin: 0 0 16px;
	border: 1px solid var(--dfim-line);
	border-radius: 12px;
	background: var(--dfim-soft);
}
.dfim-account-filters label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 0.8em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--dfim-muted); }
.dfim-account-filters input,
.dfim-account-filters select {
	min-width: 140px;
	min-height: 38px;
	padding: 6px 10px;
	border: 1px solid var(--dfim-line);
	border-radius: 9px;
	background: #fff;
	font-size: 0.95rem;
	text-transform: none;
	letter-spacing: 0;
	font-weight: 400;
	color: inherit;
}
.dfim-account-filters input:focus,
.dfim-account-filters select:focus { outline: none; border-color: var(--dfim-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dfim-accent) 20%, transparent); }
.dfim-account-filter-btns { display: flex; gap: 8px; }

.dfim-account-list { list-style: none !important; margin: 0 !important; padding: 0 !important; display: flex; flex-direction: column; gap: 10px; }
.dfim-account-item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0 !important;
	padding: 14px 16px;
	border: 1px solid var(--dfim-line);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 22px -16px rgba(15, 23, 42, 0.35);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.dfim-account-item:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 14px 30px -18px rgba(15, 23, 42, 0.45); }
.dfim-account-icon {
	width: 42px;
	height: 42px;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	color: #fff;
	background: linear-gradient(160deg, var(--dfim-accent), var(--dfim-accent-dark));
}
/*
 * The text and the buttons share one row when there is room, and the buttons
 * drop neatly underneath the text when the theme's column is narrow — so the
 * invoice number and date never get squeezed into a thin strip.
 */
.dfim-account-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; min-height: 42px; }
.dfim-account-main { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dfim-account-main strong { font-size: 1em; overflow-wrap: anywhere; }
.dfim-account-meta { font-size: 0.86em; color: var(--dfim-muted); display: flex; flex-wrap: wrap; gap: 2px 0; align-items: center; }
.dfim-account-part { white-space: nowrap; }
.dfim-account-part + .dfim-account-part::before { content: "\00B7"; content: "\00B7" / ""; margin: 0 7px; opacity: 0.7; }
.dfim-account-meta a { color: var(--dfim-accent); font-weight: 600; text-decoration: none; }
.dfim-account-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dfim-account-amount { font-weight: 700; white-space: nowrap; margin-right: 4px; }
.dfim-account-note { flex-basis: 100%; margin: 0 !important; font-size: 0.86em; font-weight: 600; color: #b91c1c; }

.dfim-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.78em; font-weight: 700; }
.dfim-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dfim-badge-paid { background: #e9f8ef; color: #15803d; }
.dfim-badge-unpaid { background: #fff4e0; color: #b45309; }
.dfim-badge-overdue { background: #fdecec; color: #b91c1c; }
.dfim-badge-cancelled { background: #f1f4f9; color: #64748b; }

.dfim-account .dfim-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 38px;
	padding: 7px 14px;
	border-radius: 10px;
	border: 1px solid transparent;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.dfim-account .dfim-btn:hover { transform: translateY(-1px); text-decoration: none; }
.dfim-account .dfim-btn-primary { background: var(--dfim-accent); color: #fff !important; box-shadow: 0 8px 18px -10px var(--dfim-accent); }
.dfim-account .dfim-btn-primary:hover { background: var(--dfim-accent-dark); }
.dfim-account .dfim-btn-plain { background: #fff; color: inherit; border-color: var(--dfim-line); }
.dfim-account .dfim-btn-plain:hover { border-color: var(--dfim-accent); color: var(--dfim-accent); }
.dfim-account .dfim-btn[disabled] { opacity: 0.6; cursor: wait; transform: none; }

.dfim-account-pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.dfim-account-pager a { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--dfim-line); text-decoration: none; font-weight: 600; color: inherit; }
.dfim-account-pager a.is-current { background: var(--dfim-accent); border-color: var(--dfim-accent); color: #fff; }

.dfim-account-empty { text-align: center; padding: 32px 16px; border: 1px dashed var(--dfim-line); border-radius: 14px; color: var(--dfim-muted); }
.dfim-account-empty p { margin: 0 0 12px; }

@media (max-width: 640px) {
	.dfim-account-side { width: 100%; }
	.dfim-account-filters label, .dfim-account-filters input, .dfim-account-filters select { width: 100%; min-width: 0; }
	.dfim-account-filter-btns { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.dfim-account-item, .dfim-account .dfim-btn { transition: none; }
}
