/*
 * CATD Meters - shared styles.
 *
 * Designed to be a visual sibling of the React owner-portal: same tokens
 * (Inter, CATD blues/greens), white rounded-xl cards with a soft shadow that
 * lifts on hover, restrained colour. Plain CSS so it works in the WP theme
 * (front-end readings page, self-registration) and lightly in wp-admin.
 */

:root {
	--font-stack: 'Inter', Roboto, Arial, sans-serif;

	--primary: #0278c0;
	--primary-hover: #015d94;
	--success: #26ad3e;
	--success-hover: #1e8f33;
	--danger: #dc3545;
	--danger-text: #c82333;

	--text-heading: #1b3a4b;
	--text-body: #2c3e50;
	--text-secondary: rgba(44, 62, 80, 0.6);

	--bg: #f4faff;
	--card: #ffffff;
	--border: rgba(0, 43, 73, 0.1);

	--radius-card: 0.75rem;   /* rounded-xl */
	--radius-button: 0.5rem;  /* rounded-lg */
	--shadow-sm: 0 1px 2px rgba(0, 43, 73, 0.06);
	--shadow-md: 0 6px 18px rgba(0, 43, 73, 0.10);
	--shadow-lg: 0 12px 32px rgba(0, 43, 73, 0.16);

	--sidebar-width: 240px;
	--topbar-height: 64px;
	--bottomnav-height: 64px;

	/* Back-compat aliases (older class names referenced these). */
	--color-primary: var(--primary);
	--color-primary-hover: var(--primary-hover);
	--color-success: var(--success);
	--color-success-hover: var(--success-hover);
	--text-body-color: var(--text-body);
	--bg-body: var(--bg);
	--bg-card: var(--card);
}

@keyframes catd-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes catd-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* ---------- Shell ---------- */

/* The hidden attribute must win over component display rules (e.g. inline-flex). */
[hidden] { display: none !important; }

.catd-app {
	font-family: var(--font-stack);
	color: var(--text-body);
	background: var(--bg);
	min-height: 100vh;
	margin: 0;
}

/* Force Inter on headings inside our screens, in case the active theme's
 * global styles try to apply a serif face to bare h1–h6 elements. */
.catd-app :is(h1, h2, h3, h4, h5, h6),
.catd-auth-page :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--font-stack);
}

.catd-container {
	max-width: 1080px;
	margin: 0 auto;
	padding: 1.5rem 1rem 4rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

/* Sticky topbar (sibling of the portal's). */
.catd-topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--card);
	border-bottom: 1px solid var(--border);
}

.catd-topbar-inner {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0.6rem 1rem;
	display: flex;
	align-items: center;
	gap: 0.75rem 1rem;
	justify-content: space-between;
	flex-wrap: wrap;
}

@media (max-width: 560px) {
	.catd-topbar-right { width: 100%; }
	.catd-select-inline { flex: 1; min-width: 0; }
}

.catd-topbar-left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.catd-topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.catd-logo { height: 44px; width: auto; object-fit: contain; }
.catd-topbar-title { font-weight: 700; color: var(--text-heading); font-size: 1.05rem; }

/* ---------- Cards ---------- */

.catd-card {
	background: var(--card);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-sm);
	padding: 1.25rem;
	transition: box-shadow 0.2s ease;
}

.catd-card-hover:hover { box-shadow: var(--shadow-md); }

.catd-card h2,
.catd-card h3 { color: var(--text-heading); font-weight: 600; margin-top: 0; }

.catd-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.catd-section-title { margin: 0 0 0.85rem; font-size: 0.95rem; font-weight: 700; color: var(--text-heading); }
.catd-subtitle { margin: 1.25rem 0 0.5rem; color: var(--text-heading); font-weight: 600; }

.catd-card-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--text-heading);
}

.catd-icon { width: 1.15rem; height: 1.15rem; color: var(--primary); flex: none; }
.catd-muted { color: var(--text-secondary); }

/* ---------- Hero (latest reading) ---------- */

.catd-hero {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: space-between;
	gap: 1.25rem;
}

.catd-hero-meta { min-width: 0; }
.catd-hero-eyebrow { display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.1rem; }
.catd-hero-name { font-size: 1.05rem; font-weight: 700; color: var(--text-heading); margin: 0; }
.catd-hero-sub { font-size: 0.85rem; color: var(--text-secondary); margin: 0.15rem 0 0; }
.catd-hero-ref { font-size: 0.78rem; color: var(--text-secondary); margin: 0.1rem 0 0; }
.catd-hero-etapa { font-size: 0.78rem; color: var(--text-secondary); margin: 0.1rem 0 0; }

/* Right side of the hero: the two headline index sections, equal height. */
.catd-hero-figure { display: flex; align-items: stretch; gap: 1rem; flex: 1 1 auto; justify-content: flex-end; }
.catd-hero-index { display: flex; flex-direction: column; padding: 0.85rem 1rem; border-radius: var(--radius-card); border: 1px solid transparent; min-width: 0; }
/* Border-only emphasis on the billing section. */
.catd-hero-index-primary { border-color: var(--primary); background: rgba(2, 120, 192, 0.03); }
.catd-hero-label { font-size: 0.78rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.catd-hero-index-primary .catd-hero-label { color: var(--text-heading); font-weight: 600; }
.catd-hero-value { font-size: 2.4rem; line-height: 1.05; font-weight: 700; color: var(--text-heading); margin-top: 0.15rem; }
.catd-hero-value-sm { font-size: 1.6rem; }
.catd-hero-unit { font-size: 1rem; font-weight: 500; color: var(--text-secondary); margin-left: 0.25rem; }
.catd-hero-times { margin-top: auto; padding-top: 0.45rem; font-size: 0.82rem; line-height: 1.55; color: var(--text-secondary); }
.catd-hero-date { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.15rem; }

.catd-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.5rem;
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.3;
	max-width: 100%;
	background: rgba(2, 120, 192, 0.08);
	color: var(--primary);
}

.catd-btn-sync {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.6rem;
	padding: 0.34rem 0.7rem;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--primary);
	background: rgba(2, 120, 192, 0.08);
	border: 1px solid rgba(2, 120, 192, 0.25);
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.15s ease;
}
.catd-btn-sync:hover { background: rgba(2, 120, 192, 0.16); }
.catd-btn-sync:disabled { opacity: 0.6; cursor: default; }
.catd-btn-sync svg { width: 14px; height: 14px; }
.catd-btn-sync .material-symbols-outlined { font-size: 1rem; }
.catd-btn-sync.is-busy svg,
.catd-btn-sync.is-busy .material-symbols-outlined { animation: catd-spin 0.8s linear infinite; }
@keyframes catd-spin { to { transform: rotate(360deg); } }

/* ---------- Stat cards ---------- */

.catd-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
}

@media (max-width: 720px) {
	.catd-stats { grid-template-columns: 1fr; }
}

.catd-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-heading); }
.catd-stat-unit { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); margin-left: 0.2rem; }
.catd-stat-label { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.15rem; }

/* ---------- Segmented toggle (sibling of the portal's) ---------- */

.catd-toggle {
	display: inline-flex;
	background: var(--border);
	border-radius: var(--radius-button);
	padding: 0.2rem;
	gap: 0.2rem;
}

.catd-toggle-btn {
	border: 0;
	background: transparent;
	padding: 0.3rem 0.85rem;
	border-radius: calc(var(--radius-button) - 0.15rem);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--text-secondary);
	cursor: pointer;
}

.catd-toggle-btn.is-active { background: var(--card); color: var(--text-heading); box-shadow: var(--shadow-sm); }

/* ---------- Forms ---------- */

.catd-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-heading); margin-bottom: 0.35rem; }

.catd-input,
.catd-select {
	width: 100%;
	box-sizing: border-box;
	padding: 0.5rem 0.7rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-button);
	font-family: var(--font-stack);
	font-size: 0.92rem;
	color: var(--text-body);
	background: #fff;
}

.catd-input:focus,
.catd-select:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 2px rgba(2, 120, 192, 0.15);
}

.catd-select-inline { width: auto; min-width: 200px; max-width: 320px; }
.catd-date { width: auto; }

/* Search wrapper styling */
.catd-search-wrapper {
	position: relative;
	width: 100%;
}
.catd-search-wrapper .catd-input {
	padding-left: 2.3rem;
	padding-right: 2.3rem;
}
.catd-search-icon {
	position: absolute;
	left: 0.8rem;
	top: 50%;
	transform: translateY(-50%);
	width: 1.1rem;
	height: 1.1rem;
	color: var(--text-secondary);
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.15rem;
}
.catd-search-clear {
	position: absolute;
	right: 0.8rem;
	top: 50%;
	transform: translateY(-50%);
	width: 1.1rem;
	height: 1.1rem;
	color: var(--text-secondary);
	border: none;
	background: transparent;
	padding: 0;
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
}
.catd-search-clear .material-symbols-outlined { font-size: 1.05rem; }
.catd-search-clear:hover {
	color: var(--danger-text);
}
.catd-search-wrapper .catd-input:placeholder-shown ~ .catd-search-clear {
	display: none;
}
.catd-search-wrapper .catd-input:not(:placeholder-shown) ~ .catd-search-clear {
	display: flex;
}
/* Hide default search clear button in webkit browsers */
.catd-input[type="search"]::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

/* Search match highlight (injected by the table search JS) */
.catd-hl {
	background: #fde68a;
	color: inherit;
	border-radius: 3px;
	padding: 0 1px;
}

.catd-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	border: none;
	border-radius: var(--radius-button);
	padding: 0.5rem 1rem;
	font-family: var(--font-stack);
	font-weight: 600;
	font-size: 0.9rem;
	color: #fff;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.catd-btn-primary { background: var(--primary); }
.catd-btn-primary:hover { background: var(--primary-hover); }
.catd-btn-success { background: var(--success); }
.catd-btn-success:hover { background: var(--success-hover); }
.catd-btn-secondary { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.catd-btn-secondary:hover { background: var(--primary); color: #fff; }

.catd-btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.catd-btn-outline:hover { color: var(--danger-text); border-color: rgba(220, 53, 69, 0.4); }

.catd-btn-danger-outline { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.catd-btn-danger-outline:hover { background: var(--danger); color: #fff; }
.catd-btn-danger-outline:disabled { opacity: 0.5; cursor: default; }
.catd-btn-danger-outline:disabled:hover { background: transparent; color: var(--danger); }

.catd-btn-ghost {
	background: transparent;
	color: var(--primary);
	border: 0;
	padding: 0.35rem 0;
	font-weight: 600;
	font-size: 0.85rem;
	cursor: pointer;
}
.catd-btn-ghost:hover { text-decoration: underline; }

/* ---------- Readings table ---------- */

.catd-rtable { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.catd-server-table { table-layout: fixed; }
.catd-server-table th,
.catd-server-table td {
	overflow: hidden;
	text-overflow: ellipsis;
}
.catd-server-table th { white-space: nowrap; }
.catd-server-table td { vertical-align: top; }
.catd-server-table .num { white-space: nowrap; }
.catd-server-table#catd-assoc-table,
.catd-server-table#catd-indep-table { width: 100%; }
#catd-assoc-table th:nth-child(1),
#catd-assoc-table td:nth-child(1) { width: 34%; }
#catd-assoc-table th:nth-child(2),
#catd-assoc-table td:nth-child(2) { width: 9%; }
#catd-assoc-table th:nth-child(3),
#catd-assoc-table td:nth-child(3) { width: 25%; }
#catd-assoc-table th:nth-child(4),
#catd-assoc-table td:nth-child(4) { width: 32%; }
#catd-indep-table th:nth-child(1),
#catd-indep-table td:nth-child(1) { width: 18%; }
#catd-indep-table th:nth-child(2),
#catd-indep-table td:nth-child(2) { width: 10%; }
#catd-indep-table th:nth-child(3),
#catd-indep-table td:nth-child(3) { width: 14%; }
#catd-indep-table th:nth-child(4),
#catd-indep-table td:nth-child(4) { width: 38%; }
#catd-indep-table th:nth-child(5),
#catd-indep-table td:nth-child(5) { width: 20%; }
.catd-rtable th {
	text-align: left;
	padding: 0.55rem 0.7rem;
	color: var(--text-secondary);
	font-weight: 600;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	border-bottom: 1px solid var(--border);
}
.catd-rtable td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); color: var(--text-body); }
.catd-rtable tr:last-child td { border-bottom: 0; }
.catd-rtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.catd-rtable .latest td { background: rgba(2, 120, 192, 0.04); font-weight: 600; color: var(--text-heading); }

/* ---------- Dashboard reconciliation: per-category census ---------- */
.catd-recon-totals { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-bottom: 1.2rem; color: var(--text-secondary); font-size: 0.92rem; line-height: 1.4; }
.catd-recon-totals > span,
.catd-recon-totals > a { display: inline-flex; align-items: center; }
.catd-recon-big { font-size: 1.4rem; font-weight: 700; color: var(--text-heading); margin-right: 0.25rem; line-height: 1; }
.catd-recon-eq { font-size: 1.15rem; color: var(--text-secondary); line-height: 1; }
.catd-census th,
.catd-census td { vertical-align: middle; }
.catd-census tfoot td { font-weight: 600; border-top: 2px solid var(--border); color: var(--text-heading); background: rgba(0, 0, 0, 0.01); }
.catd-census-group { text-align: center !important; background: rgba(0, 0, 0, 0.02); border-bottom: 1px solid var(--border) !important; color: var(--text-heading); font-weight: 600; }

/* ---------- Map ---------- */

#catd-map { width: 100%; height: 60vh; min-height: 22rem; max-height: 75vh; border-radius: var(--radius-button); z-index: 0; }

/* Citiri: scrollable card capped to the same height as the map. */
.catd-rtable-wrap { max-height: 75vh; overflow-y: auto; }
.catd-map-wrap { position: relative; }

/* ---------- Loading skeletons ---------- */

@keyframes catd-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Inline placeholder for a single value/line. Width/height come from per-element
 * custom properties so each bar matches the text it replaces (no layout shift). */
.catd-skel {
	display: inline-block;
	vertical-align: middle;
	width: var(--skel-w, 6ch);
	height: var(--skel-h, 0.9em);
	border-radius: 6px;
	color: transparent !important;
	background-image: linear-gradient(90deg, #e9eef3 25%, #dde4ea 37%, #e9eef3 63%);
	background-size: 400% 100%;
	animation: catd-shimmer 1.4s ease infinite;
}
.catd-skel > * { visibility: hidden; }

/* Full-area placeholder overlaid on the chart and map (those boxes are fixed-height). */
.catd-skel-block {
	position: absolute;
	inset: 0;
	z-index: 2;
	border-radius: var(--radius-button);
	background-image: linear-gradient(90deg, #e9eef3 25%, #dde4ea 37%, #e9eef3 63%);
	background-size: 400% 100%;
	animation: catd-shimmer 1.4s ease infinite;
}
.catd-skel-block[hidden] { display: none; }
#catd-map-skel { z-index: 1100; } /* above Leaflet's controls while the map loads */

@media (prefers-reduced-motion: reduce) {
	.catd-skel, .catd-skel-block { animation: none; }
}

/* ---------- Banners / states ---------- */

.catd-alert {
	border-left: 3px solid;
	padding: 0.75rem 0.9rem;
	border-radius: 0 var(--radius-button) var(--radius-button) 0;
	font-size: 0.9rem;
	margin: 0.5rem 0;
	text-align: left;
}
.catd-alert-error { background: rgba(220, 53, 69, 0.06); border-color: var(--danger-text); color: var(--danger-text); }
.catd-alert-success { background: rgba(38, 173, 62, 0.06); border-color: var(--success-hover); color: var(--success-hover); }
.catd-alert-info { background: rgba(2, 120, 192, 0.06); border-color: var(--primary); color: var(--text-body); }

.catd-empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-secondary); }
.catd-empty .catd-icon { width: 2.2rem; height: 2.2rem; margin: 0 auto 0.6rem; opacity: 0.5; color: var(--text-secondary); }

.catd-skeleton {
	background: linear-gradient(90deg, #eef4fa 25%, #f7fbff 50%, #eef4fa 75%);
	background-size: 200% 100%;
	animation: catd-shimmer 1.2s infinite;
	border-radius: 6px;
}

.catd-fade-in { animation: catd-fade-in 0.3s ease-out; }

/* ---------- Auth / registration card ---------- */

.catd-auth-card {
	max-width: 420px;
	margin: 2.5rem auto;
	background: var(--card);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-sm);
	padding: 2rem;
	font-family: var(--font-stack);
	color: var(--text-body);
}

.catd-auth-title { color: var(--text-heading); font-size: 1.25rem; font-weight: 600; margin: 0 0 0.25rem; }
.catd-auth-help { font-size: 0.9rem; color: var(--text-secondary); margin: 0 0 1.25rem; }
.catd-auth-card .catd-input { margin-bottom: 1rem; }
.catd-auth-card .catd-btn { width: 100%; justify-content: center; }

/* Password field with a show/hide toggle inside it. */
.catd-pwd-wrap { position: relative; margin-bottom: 1rem; }
.catd-auth-card .catd-pwd-wrap .catd-input { margin-bottom: 0; padding-right: 2.6rem; }
.catd-pwd-toggle {
	position: absolute;
	right: 0.5rem;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.9rem;
	height: 1.9rem;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--text-secondary);
	cursor: pointer;
}
.catd-pwd-toggle:hover { color: var(--primary); }
.catd-pwd-toggle .material-symbols-outlined { font-size: 1.2rem; }

/* Login form: field labels + the remember-me / forgot-password row. */
.catd-field-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-heading); margin: 0 0 0.35rem; }
.catd-login-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: -0.25rem 0 1.25rem; font-size: 0.85rem; }
.catd-remember { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-body); cursor: pointer; }
.catd-remember input { margin: 0; }

/* Association picker: a custom autocomplete (works the same on mobile + desktop). */
.catd-combo { position: relative; margin-bottom: 1rem; }
.catd-combo .catd-input { margin-bottom: 0; }
.catd-combo-list {
	position: absolute;
	top: calc( 100% + 4px );
	left: 0;
	right: 0;
	z-index: 50;
	margin: 0;
	padding: 0.25rem;
	list-style: none;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-button);
	box-shadow: var(--shadow-md);
	max-height: 16rem;
	overflow-y: auto;
}
.catd-combo-list[hidden] { display: none; }
.catd-combo-option {
	padding: 0.6rem;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.92rem;
	line-height: 1.3;
	color: var(--text-body);
}
.catd-combo-option:hover,
.catd-combo-option.is-active { background: rgba(2, 120, 192, 0.1); }
.catd-combo-empty,
.catd-combo-more { padding: 0.55rem 0.6rem; font-size: 0.8rem; color: var(--text-secondary); }

/* =====================================================================
 * App shell (readings page): a single fixed topbar + full-width card grid.
 * ===================================================================== */

.catd-appbar {
	position: sticky;          /* reserves its own height so it never covers content */
	top: 0;
	z-index: 55;
	min-height: var(--topbar-height);
	background: var(--card);
	border-bottom: 1px solid var(--border);
	display: flex;
	align-items: center;
	gap: 0.6rem 1rem;
	flex-wrap: wrap;
	padding: 0.55rem 1rem;
}

.catd-appbar-logo { height: 44px; width: auto; object-fit: contain; flex: none; }
.catd-appbar-title { font-size: 1.05rem; font-weight: 700; color: var(--text-heading); margin: 0; flex: 1; min-width: 0; }
.catd-appbar-title small { display: block; font-size: 0.72rem; font-weight: 500; color: var(--text-secondary); }

/* Meter selector styled like the portal's location selector. */
.catd-meterselect {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.4rem 0.6rem;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-button);
	box-shadow: var(--shadow-sm);
}
.catd-meterselect svg { width: 1rem; height: 1rem; color: var(--text-heading); flex: none; }
.catd-meterselect .material-symbols-outlined { font-size: 1.15rem; color: var(--text-heading); }
.catd-meterselect select {
	border: 0; background: transparent; font-family: var(--font-stack);
	font-size: 0.85rem; font-weight: 600; color: var(--text-heading);
	max-width: 48vw; outline: none;
}

.catd-meterselect-label {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Logged-in association identity, shown next to the logout button. */
.catd-appbar-user {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	max-width: 28vw;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--text-heading);
	border: 0;
	background: transparent;
	padding: 0;
	cursor: pointer;
	font-family: var(--font-stack);
}
.catd-appbar-user svg { width: 1rem; height: 1rem; color: var(--text-secondary); flex: none; }
.catd-appbar-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catd-appbar-user-caret { display: inline-flex; align-items: center; justify-content: center; line-height: 1; color: var(--text-secondary); transition: transform 0.15s ease; }
.catd-appbar-account.is-open .catd-appbar-user-caret { transform: rotate(180deg); }

/* Account cluster (identity → dropdown menu) and the selector wrapper. */
.catd-appbar-account { display: inline-flex; align-items: center; gap: 0.6rem; position: relative; }
.catd-appbar-select { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; }

/* User menu: a dropdown anchored under the username, on every screen size. */
.catd-appbar-menu {
	display: none;
	position: absolute;
	top: calc(100% + 0.5rem);
	right: 0;
	min-width: 12rem;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-button);
	box-shadow: var(--shadow-md);
	padding: 0.35rem;
	z-index: 60;
}
.catd-appbar-account.is-open .catd-appbar-menu { display: block; }
.catd-menu-item {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	width: 100%;
	box-sizing: border-box;
	padding: 0.5rem 0.6rem;
	border: 0;
	background: transparent;
	border-radius: calc(var(--radius-button) - 0.15rem);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--text-body);
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}
.catd-menu-item svg { width: 1rem; height: 1rem; flex: none; color: var(--text-secondary); }
.catd-menu-item:hover { background: var(--bg); }
.catd-menu-item-danger { color: var(--danger); }
.catd-menu-item-danger svg { color: var(--danger); }
.catd-menu-item-danger:hover { background: rgba(220, 53, 69, 0.08); }

/* Mobile header: drop the title and give the address selector its own full-width
 * row. The sticky bar reserves its (now taller) height, so it never overlaps the
 * page content; the user menu dropdown behaves the same as on desktop. */
@media (max-width: 768px) {
	.catd-appbar { padding: 0.5rem 0.75rem; gap: 0.45rem 0.6rem; }
	.catd-appbar-logo { height: 30px; order: 1; }
	.catd-appbar-title { display: none; }
	.catd-appbar-account { order: 2; margin-left: auto; }
	.catd-appbar-select { order: 3; flex-basis: 100%; width: 100%; }
	.catd-appbar-select .catd-meterselect { flex: 1; min-width: 0; }
	.catd-meterselect select { max-width: none; width: 100%; flex: 1; }
	.catd-appbar-user { max-width: 62vw; }
	.catd-appbar-menu { min-width: 13rem; }
}

.catd-btn-logout {
	background: transparent;
	color: var(--danger);
	border: 1px solid var(--danger);
}
.catd-btn-logout svg { width: 1rem; height: 1rem; }
.catd-btn-logout:hover { background: var(--danger); color: #fff; }

.catd-main { padding: 1.5rem 1rem 2.5rem; }

.catd-content {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 1rem;
	align-items: start;
}

.catd-span-3 { grid-column: span 3; }
.catd-span-4 { grid-column: span 4; }
.catd-span-5 { grid-column: span 5; }
.catd-span-6 { grid-column: span 6; }
.catd-span-7 { grid-column: span 7; }
.catd-span-8 { grid-column: span 8; }
.catd-span-12 { grid-column: span 12; }

@media (max-width: 960px) {
	.catd-content > * { grid-column: span 12 !important; }
}

/* Interval-dependent grouping container (date selector + stats + chart).
 * A light bordered region, not a heavy card, so the stat/chart cards inside
 * don't read as a box-in-a-box. */
.catd-interval {
	background: rgba(2, 120, 192, 0.03);
	border: 1px solid var(--border);
	border-radius: var(--radius-card);
	padding: 1rem;
}
.catd-interval-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	margin-bottom: 1rem;
}
.catd-interval-dates { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.catd-interval-grid {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 1rem;
	align-items: stretch; /* the 4 stat cards share one row height */
}
@media (max-width: 960px) {
	.catd-interval-grid .catd-span-3 { grid-column: span 6; }
}
@media (max-width: 600px) {
	.catd-interval-grid .catd-span-3 { grid-column: span 12; }
}

/* Emphasised card - border accent only (same card size as its siblings). */
.catd-stat-accent {
	border: 1px solid var(--primary);
}
.catd-stat-sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* Chart header controls: grouping (Zi/Săptămână/Lună) + series (Consum/Index). */
.catd-chart-controls { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.catd-toggle-btn:disabled, .catd-toggle-btn.is-disabled { opacity: 0.38; cursor: not-allowed; }

/* ---------- Modal (account settings) ---------- */

.catd-modal {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}
.catd-modal.is-open { opacity: 1; visibility: visible; }
.catd-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 43, 73, 0.45); }
.catd-modal-card {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 460px;
	max-height: 90vh;
	max-height: min(90vh, calc(100dvh - 2rem));
	overflow-y: auto;
	background: var(--card);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-lg);
	padding: 1.5rem;
	font-family: var(--font-stack);
	opacity: 0;
	transform: translateY(14px) scale(0.98);
	transition: opacity 0.22s ease, transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.catd-modal.is-open .catd-modal-card { opacity: 1; transform: translateY(0) scale(1); }
@media (max-width: 600px) {
	.catd-modal-card { padding: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
	.catd-modal, .catd-modal-card { transition: none; }
	.catd-modal-card { transform: none; }
}
.catd-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.catd-modal-close {
	border: 0;
	background: transparent;
	cursor: pointer;
	color: var(--text-secondary);
	padding: 0.25rem;
	line-height: 0;
	border-radius: var(--radius-button);
}
.catd-modal-close svg { width: 1.2rem; height: 1.2rem; }
.catd-modal-close:hover { background: var(--bg); color: var(--text-heading); }
.catd-modal-sep { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0 1.1rem; }

.catd-switch { display: flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; color: var(--text-body); cursor: pointer; }
.catd-switch input { flex: none; width: 1rem; height: 1rem; accent-color: var(--primary); cursor: pointer; }

.catd-field-email { margin-top: 1rem; transition: opacity 0.15s ease; }
.catd-field-email.is-disabled { opacity: 0.5; }

.catd-delete-confirm { margin-top: 0.85rem; }

.catd-pass-rules { list-style: none; margin: 0.6rem 0 0; padding: 0; font-size: 0.8rem; }
.catd-pass-rules li { color: #8a97a3; padding: 0.12rem 0 0.12rem 1.45rem; position: relative; }
.catd-pass-rules li::before { content: "○"; position: absolute; left: 0; }
.catd-pass-rules li.is-ok { color: #1d7a33; }
.catd-pass-rules li.is-ok::before { content: "✓"; }

@media (min-width: 1024px) {
	.catd-meterselect select { max-width: 320px; }
	.catd-main { padding: 1.5rem 1.5rem 2.5rem; }
}

/* =====================================================================
 * Auth screen (registration / self-service) - frosted card over a photo.
 * ===================================================================== */

.catd-auth-page {
	font-family: var(--font-stack);
	color: var(--text-body);
	min-height: 100vh;
	margin: 0;
	position: relative;
}

/* The portal gets border-box globally from Tailwind; replicate that here so the
 * card and its full-width buttons include their padding in width:100% and stay
 * inside the wrap's side gutter instead of bleeding to the screen edges. */
.catd-auth-page *,
.catd-auth-page *::before,
.catd-auth-page *::after { box-sizing: border-box; }

.catd-auth-bg { position: fixed; inset: 0; background-size: cover; background-position: center; }
.catd-auth-overlay {
	position: fixed; inset: 0;
	background: linear-gradient(to bottom, rgba(244, 250, 255, 0.97), rgba(244, 250, 255, 0.66), rgba(244, 250, 255, 0.93));
	backdrop-filter: blur(2px);
}

.catd-auth-wrap {
	position: relative;
	z-index: 1;
	max-width: 460px;
	margin: 0 auto;
	min-height: 100vh;
	/* Flex column flow (sibling of the portal's AuthShell): logo + card sit at the
	 * top, the footer is pushed to the bottom edge via margin-top:auto. A min-width
	 * media query below re-centers the whole group vertically on desktop. */
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 2rem 1rem;
	box-sizing: border-box;
}
.catd-auth-head { width: 100%; }

.catd-auth-logo { height: 80px; object-fit: contain; margin: 0 auto 0.75rem; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1)); }
.catd-auth-brand { text-align: center; font-weight: 600; color: var(--text-heading); margin: 0 0 1.25rem; font-size: 1.05rem; }

.catd-auth-page .catd-auth-card {
	margin: 0;
	width: 100%;
	max-width: 420px;
	box-shadow: var(--shadow-lg);
	border: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.96);
}

.catd-auth-foot { text-align: center; color: var(--text-body); font-size: 0.85rem; margin-top: auto; width: 100%; }
.catd-auth-foot strong { color: var(--text-body); font-weight: 600; }
.catd-auth-foot .dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--text-secondary); margin: 0 0.5rem; vertical-align: middle; }
.catd-auth-foot .catd-btn-secondary { margin-top: 0.5rem; }
.catd-auth-support { margin-top: 0.9rem; font-size: 0.82rem; color: var(--text-secondary); }
.catd-auth-support a { color: var(--primary); }

/* In-card alternate action: a short centered rule, the prompt, then the secondary
 * button (register link on the login card, login link on the register card). */
.catd-auth-sep { width: 55%; margin: 1.5rem auto 1.1rem; border: 0; border-top: 1px solid var(--border); }
.catd-auth-alt { text-align: center; }
.catd-auth-alt p { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--text-secondary); }

/* Auth screens on phones: dvh so the URL bar doesn't force a scroll, tighter
 * card/wrap padding, smaller logo. 16px inputs stop iOS zooming on focus. */
@media (max-width: 600px) {
	.catd-auth-page { min-height: 100dvh; }
	.catd-auth-wrap { min-height: 100dvh; padding: 1.25rem 1.25rem; }
	.catd-auth-logo { height: 64px; margin-bottom: 0.5rem; }
	.catd-auth-brand { margin-bottom: 0.9rem; }
	.catd-auth-page .catd-auth-card { padding: 1.5rem 1.25rem; }
	/* margin-top:auto (base) pushes the footer to the bottom; just add breathing room. */
	.catd-auth-foot { padding-top: 1rem; }
	.catd-input,
	.catd-select { font-size: 16px; }
}

/* Auth on desktop: re-center the logo + card + footer group vertically. */
@media (min-width: 768px) {
	.catd-auth-wrap { justify-content: center; }
	.catd-auth-foot { margin-top: 1.5rem; }
}

/* Help trigger (registration instructions) */
.catd-help-trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.7rem;
	background: none;
	border: none;
	color: var(--text-secondary);
	font-size: 0.78rem;
	cursor: pointer;
	font-family: var(--font-stack);
	padding: 0;
}
.catd-help-trigger svg {
	width: 15px;
	height: 15px;
	flex: none;
}
.catd-help-trigger-text { text-decoration: underline; text-underline-offset: 2px; }
.catd-help-trigger:hover { color: var(--primary); }

/* Wide variant of the modal card (for the help steps) */
.catd-modal-card--wide { max-width: 560px; text-align: left; }

/* Step-by-step list inside the help modal */
.catd-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.catd-step { display: flex; gap: 1rem; align-items: flex-start; }
.catd-step-num {
	flex: none;
	width: 2rem; height: 2rem;
	border-radius: 50%;
	background: var(--primary);
	color: #fff;
	font-weight: 700;
	font-size: 0.88rem;
	display: flex; align-items: center; justify-content: center;
	margin-top: 0.1rem;
}
.catd-step-body { flex: 1; }
.catd-step-body strong { display: block; font-size: 0.95rem; color: var(--text-heading); margin-bottom: 0.2rem; }
.catd-step-body p { margin: 0; font-size: 0.88rem; color: var(--text-body); line-height: 1.5; }
.catd-step-example { display: block; margin-top: 0.3rem; font-size: 0.8rem; color: var(--text-secondary); font-style: italic; }
.catd-step-notes { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-body); display: flex; flex-direction: column; gap: 0.5rem; }
.catd-step-notes p { margin: 0; }
.catd-step-notes a { color: var(--primary); }
.catd-modal-title { font-size: 1.1rem; font-weight: 700; color: var(--text-heading); margin: 0; }

/* ---------- Radio group (format picker) ---------- */
.catd-radio-group { display: flex; gap: 1.25rem; align-items: center; }
.catd-radio-group label { display: flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; cursor: pointer; }
.catd-fieldset { border: none; margin: 0; padding: 0; }
.catd-fieldset legend.catd-section-title { float: left; width: 100%; }

/* ---------- Admin (wp-admin) ---------- */

.catd-wrap .catd-card { max-width: 1100px; margin-bottom: 1.25rem; }
.catd-tabs { margin-bottom: 1rem; }

.catd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 860px) { .catd-grid { grid-template-columns: 1fr; } }

.catd-inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.catd-inline-form input[type="text"],
.catd-inline-form input[type="email"] { min-width: 220px; }

/* =====================================================================
 * Internal dashboard (departament intern) - same tokens as the rest.
 * ===================================================================== */

/* View tabs: portal-style nav pills (sibling of the demo's sidebar items). */
.catd-int-nav { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.catd-dashboard-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1rem;
}
@media (max-width: 960px) { .catd-dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .catd-dashboard-stats { grid-template-columns: 1fr; } }

.catd-table-meta,
.catd-table-pager {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
	flex-wrap: wrap;
	font-size: 0.85rem;
	color: var(--text-secondary);
}
.catd-table-pager-info,
.catd-table-pager-current { font-variant-numeric: tabular-nums; }
.catd-table-pager-actions { display: inline-flex; align-items: center; gap: 0.45rem; }

/* Footer row: page-size selector on the left, pager on the right. */
.catd-table-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-top: 0.5rem;
}
.catd-table-footer .catd-table-pager { flex: 1 1 auto; }
.catd-perpage-label {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem;
	color: var(--text-secondary);
}
.catd-perpage {
	padding: 0.25rem 0.4rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--surface, #fff);
	font: inherit;
	font-size: 0.85rem;
}

.catd-table-sort,
.catd-sort-link {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-weight: 600;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}
.catd-table-sort {
	display: flex;
	align-items: center;
	/* Icon hugs the label; width 100% keeps the whole header cell clickable. */
	justify-content: flex-start;
	gap: 0.4rem;
	width: 100%;
}
.catd-rtable th.num .catd-table-sort { justify-content: flex-end; }
.catd-table-sort .catd-sort-icon {
	display: none;
	/* Inline SVGs need explicit dimensions; font-size does not size them. */
	width: 1.05rem;
	height: 1.05rem;
	font-size: 1.05rem;
	line-height: 1;
	flex: none;
	color: var(--text-secondary);
}
.catd-table-sort.is-sorted { color: var(--text-heading); font-weight: 700; }
.catd-table-sort.is-sorted .catd-sort-icon { display: inline-block; }
.catd-table-sort.is-sorted[data-sort-dir="asc"] .catd-sort-icon-up { display: inline-block; color: var(--primary); }
.catd-table-sort.is-sorted[data-sort-dir="desc"] .catd-sort-icon-down { display: inline-block; color: var(--primary); }
.catd-table-sort.is-sorted .catd-sort-icon-none { display: none; }
.catd-table-sort.is-sorted[data-sort-dir="asc"] .catd-sort-icon-down,
.catd-table-sort.is-sorted[data-sort-dir="desc"] .catd-sort-icon-up { display: none; }
.catd-table-sort:hover { color: var(--primary); text-decoration: none; }
/* Underline only the label on hover, not the icon-font sort glyphs. */
.catd-table-sort:hover > span:not(.material-symbols-outlined) { text-decoration: underline; }
.catd-sort-link:hover { color: var(--primary); text-decoration: underline; }
.catd-table-sort:focus-visible,
.catd-sort-link:focus-visible { outline: 2px solid rgba(2, 120, 192, 0.35); outline-offset: 2px; border-radius: 4px; }

.catd-int-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.45rem 0.95rem;
	border-radius: var(--radius-button);
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--text-heading);
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.catd-int-tab:hover { background: rgba(2, 120, 192, 0.06); color: var(--primary); }
.catd-int-tab.is-active { background: rgba(2, 120, 192, 0.14); color: var(--primary); }

/* Small outline action button for table rows (portal's per-row actions).
 * Carries two icons: the idle one and a spinner shown while the CSV is
 * being generated server-side (.is-busy, toggled by the page script). */
.catd-btn-table {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.7rem;
	font-family: var(--font-stack);
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--text-secondary);
	background: transparent;
	border: 1px solid var(--border);
	border-radius: var(--radius-button);
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.catd-btn-table:hover { color: var(--primary); border-color: rgba(2, 120, 192, 0.4); background: rgba(2, 120, 192, 0.04); }

/* Per-row action buttons (Vezi contoare / CSV / XLSX) sit on a single row with even
 * spacing. The table reserves enough width for them via #catd-assoc-table min-width,
 * so on narrow viewports the whole table scrolls laterally rather than wrapping these
 * onto cramped extra lines. */
.catd-row-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: nowrap; gap: 0.4rem; }
.catd-btn-table svg { width: 14px; height: 14px; flex: none; }
.catd-btn-table .catd-ico-busy { display: none; }
.catd-btn-table.is-busy { pointer-events: none; color: var(--primary); border-color: rgba(2, 120, 192, 0.4); }
.catd-btn-table.is-busy .catd-ico-idle { display: none; }
.catd-btn-table.is-busy .catd-ico-busy { display: inline-block; animation: catd-spin 0.8s linear infinite; }

/* Same busy spinner on regular buttons (overall export). No fixed width/height:
 * the glyph renders at 1.15rem (see .catd-btn .material-symbols-outlined) and a
 * smaller box would offset the rotation centre and make the spinner wobble. */
.catd-btn .catd-ico-busy { display: none; }
.catd-btn.is-busy .catd-ico-idle { display: none; }
.catd-btn.is-busy .catd-ico-busy { display: inline-block; line-height: 1; animation: catd-spin 0.8s linear infinite; }
.catd-btn:disabled { opacity: 0.7; cursor: default; }

.catd-badge-muted {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.3;
	background: rgba(0, 43, 73, 0.06);
	color: var(--text-secondary);
}

/* Per-association etape: inline pills that wrap neatly within the table cell. */
.catd-etape-cell { line-height: 2; word-spacing: 0.15rem; }
.catd-etape-cell .catd-badge-muted { margin: 0.1rem 0; }

/* Helper paragraph under section titles (front-end version of wp-admin's
 * .description, which has no styles outside wp-admin). */
.catd-desc { font-size: 0.875rem; color: var(--text-secondary); margin: 0.25rem 0 0.9rem; }

.catd-link { color: var(--primary); text-decoration: none; }
.catd-link:hover { text-decoration: underline; }

.catd-progress { height: 10px; background: rgba(0, 43, 73, 0.08); border-radius: 999px; overflow: hidden; margin: 0.75rem 0; }
.catd-progress-bar { height: 100%; width: 2%; background: var(--primary); border-radius: 999px; transition: width 0.2s ease; }

.catd-sync-log {
	background: #0b2436;
	color: #cfe6f5;
	font-size: 0.78rem;
	padding: 0.75rem;
	border-radius: var(--radius-button);
	max-height: 160px;
	overflow: auto;
	white-space: pre-wrap;
}

/* Etape tab: per-month day-of-month inputs. Native number spinners overlap the
 * value at the compact width this dense 12-column grid needs, so hide them - the
 * day is typed (inputmode=numeric gives a numeric keypad on mobile). */
.catd-day-input {
	width: 3.6em;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}
.catd-day-input::-webkit-outer-spin-button,
.catd-day-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ---------- Mobile overflow hardening ---------- */

/* Grid/flex items default to min-width:auto (= min-content), so one wide,
 * non-wrapping child (a long <select> option, the date range, a segmented
 * toggle) can stretch its track past the viewport and scroll the whole page.
 * Letting these containers' children shrink keeps everything on-screen. */
.catd-content > *,
.catd-interval-grid > *,
.catd-interval-dates,
.catd-card-head { min-width: 0; }

/* A long serial / address / association name wraps instead of overflowing. (Not
 * the headers - they are short single words that must never break mid-word.) */
.catd-hero-name,
.catd-hero-sub,
.catd-rtable td { overflow-wrap: anywhere; }

/* Data tables stay readable on phones: if the columns still can't fit (e.g. a
 * CSV button + a date + counts), the table scrolls horizontally inside its card
 * instead of clipping the right-hand columns off-screen. */
.catd-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.catd-rtable-wrap { overflow-x: auto; }

/* Give the fixed-layout server tables a sane minimum so narrow viewports scroll the
 * wrapper laterally instead of crushing every column into an unreadable sliver. */
#catd-assoc-table { min-width: 1040px; }
#catd-indep-table { min-width: 720px; }
#catd-reader-table { min-width: 880px; }
#catd-excluse-table { min-width: 720px; }

/* wp-admin list tables (Contoare / Independente / Asociație) clip on small screens;
 * wrap them so they scroll laterally with a readable minimum width. Scoped to our
 * wrapper class so other admin list tables are untouched. */
.catd-admin-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.catd-admin-table-scroll .wp-list-table { min-width: 760px; }

@media (max-width: 600px) {
	/* Stack the "interval" header so the date range gets its own full-width row
	 * (it cannot fit beside the heading on a phone). */
	.catd-interval-head { flex-direction: column; align-items: stretch; }
	/* One "label + input" pair per row: 2-col grid, the input fills the second column. */
	.catd-interval-dates { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 0.6rem; align-items: center; width: 100%; }

	/* Card headers that carry a segmented toggle (Evoluție, Citiri, Export etape):
	 * drop the controls onto their own row instead of clipping them. */
	.catd-card-head { flex-direction: column; align-items: stretch; }
	.catd-card-head > .catd-toggle,
	.catd-card-head > .catd-chart-controls,
	.catd-card-head > form { align-self: stretch; }

	/* Roomier tap targets for the pill controls. */
	.catd-toggle-btn { padding: 0.5rem 0.85rem; }
	.catd-btn-sync { padding: 0.45rem 0.9rem; }
}

/* Hero (first card) on phones: stack the meter identity above the index figure, and
 * left-align the figure so its value/date line up under the meta. The map is capped
 * so it doesn't dominate the scroll. */
@media (max-width: 600px) {
	.catd-hero { flex-direction: column; align-items: stretch; gap: 0.75rem; }
	.catd-hero-figure { flex-direction: column; padding-top: 0.75rem; border-top: 1px solid var(--border); }
	#catd-map { height: 45vh; min-height: 16rem; }
}

/* ----------------------------------------------------------------------
   Admin: sortable headers inside .wp-list-table (reuse .catd-table-sort).
   ---------------------------------------------------------------------- */
.wp-list-table th .catd-table-sort { width: 100%; }

/* ----------------------------------------------------------------------
   Internal dashboard: expandable per-association meter list.
   ---------------------------------------------------------------------- */
.catd-assoc-toggle .catd-assoc-chev {
	width: 14px;
	height: 14px;
	flex: none;
	transition: transform 0.15s ease;
}
.catd-assoc-toggle.is-open .catd-assoc-chev { transform: rotate( 180deg ); }
/* Highlight parent row when expanded */
.catd-server-table tr.is-expanded td {
	background: rgba(2, 120, 192, 0.03);
}

.catd-assoc-meters-row > td {
	padding: 0;
	background: var( --surface-2, #f6f9fc );
}
.catd-assoc-meters-scroll {
	max-height: 0;
	overflow: hidden;
	padding: 0 0.75rem;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 43, 73, 0.15) transparent;
	box-shadow: inset 0 2px 6px rgba(0, 43, 73, 0.04);
	transition: max-height 0.2s ease-in-out, padding 0.2s ease-in-out;
}
.catd-assoc-meters-row.is-open .catd-assoc-meters-scroll {
	max-height: 320px;
	overflow: auto;
	padding: 0 0.75rem 0.5rem 0.75rem;
}

/* Custom scrollbar for WebKit engines */
.catd-assoc-meters-scroll::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}
.catd-assoc-meters-scroll::-webkit-scrollbar-track {
	background: transparent;
}
.catd-assoc-meters-scroll::-webkit-scrollbar-thumb {
	background: rgba(0, 43, 73, 0.15);
	border-radius: 3px;
}
.catd-assoc-meters-scroll::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 43, 73, 0.3);
}

.catd-assoc-meters-inner {
	margin: 0;
	width: 100%;
}
.catd-assoc-meters-inner th {
	position: sticky;
	top: 0;
	background: var( --surface-2, #f6f9fc );
	z-index: 1;
	border-bottom: 2px solid var(--border);
	padding-top: 0.6rem;
	padding-bottom: 0.6rem;
}
.catd-assoc-meters-inner td,
#catd-assoc-meters-table td {
	vertical-align: top;
}
.catd-assoc-meters-inner td {
	border-bottom: 1px solid var(--border);
}
.catd-assoc-meters-inner tr:last-child td {
	border-bottom: 0;
}
.catd-assoc-meters-inner td:nth-child(1),
.catd-assoc-meters-inner td:nth-child(3) {
	white-space: nowrap;
}

/* ---- Topbar view nav (departament intern) ---- */
.catd-appbar-logo-link { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.catd-appbar-nav {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.25rem;
}
.catd-appbar-nav .catd-int-tab { padding: 0.4rem 0.8rem; font-size: 0.88rem; }
@media (max-width: 860px) {
	.catd-appbar-nav {
		order: 3;
		flex-basis: 100%;
		width: 100%;
		justify-content: flex-start;
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	.catd-appbar-nav .catd-int-tab { flex: none; white-space: nowrap; }
}

/* ---- Collapsible card (smooth height + rotating chevron) ---- */
.catd-collapsible-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	width: 100%;
	box-sizing: border-box;
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	color: var(--text-heading);
	text-align: left;
	cursor: pointer;
}
.catd-collapsible-title {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
}
.catd-collapsible-chevron {
	flex: none;
	color: var(--text-secondary);
	transition: transform 0.2s ease;
	font-size: 1.2rem;
}
.catd-collapsible.is-open .catd-collapsible-chevron { transform: rotate(180deg); }
.catd-collapsible-body {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.25s ease;
}
.catd-collapsible.is-open .catd-collapsible-body { grid-template-rows: 1fr; }
.catd-collapsible-inner { overflow: hidden; min-height: 0; }
.catd-collapsible.is-open .catd-collapsible-inner { padding-top: 0.85rem; }

/* ---- Export type switcher (segmented) + panels ---- */
.catd-segmented {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-button);
	padding: 0.25rem;
	margin-bottom: 1.1rem;
}
.catd-segmented-btn {
	border: 0;
	background: transparent;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	font-size: 0.85rem;
	color: var(--text-body);
	padding: 0.4rem 0.9rem;
	border-radius: calc(var(--radius-button) - 0.15rem);
	transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.catd-segmented-btn:hover { color: var(--primary); }
.catd-segmented-btn.is-active {
	background: var(--card);
	color: var(--primary);
	box-shadow: var(--shadow-sm);
}
.catd-export-panel[hidden] { display: none; }
.catd-hub-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.6rem 0.9rem;
}

/* Consistent action buttons across all 4 export options (Panou) */
.catd-export-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.85rem;
}
.catd-hub-row .catd-export-actions { margin-top: 0; }
/* Equalize button heights: primary has no border, secondary a 2px one. */
.catd-export-panel .catd-btn { border: 2px solid transparent; }
.catd-export-panel .catd-btn-secondary { border-color: var(--primary); }
/* Format chooser as a bordered inline group (matches the city export). */
.catd-fmt-group {
	display: inline-flex;
	gap: 0.85rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-button);
	padding: 0.4rem 0.7rem;
}
.catd-fmt-group label {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.83rem;
	font-weight: 600;
	color: var(--text-body);
	cursor: pointer;
	margin: 0;
}

/* ---- Ledger primitive ----
   A bordered card whose rows pair a right-aligned tabular number with a label
   block and (optionally) a controls column. The number column has a fixed
   min-width so numbers stack on the same axis across all rows AND across
   different ledgers on the same page; tabular-nums keeps digit columns true.
   Shared by every "counts + breakdown" surface in the app: system overview,
   reconciliation, by-etapă, General export filter. */
.catd-ledger {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 12px;
	overflow: hidden;
}
.catd-ledger-row {
	display: grid;
	grid-template-columns: minmax(5.5rem, max-content) 1fr auto;
	align-items: center;
	gap: 1rem;
	padding: 0.95rem 1.15rem;
}
.catd-ledger-row + .catd-ledger-row { border-top: 1px solid var(--border); }
/* Two-column variant: bare label + number, no controls (by-etapă). */
.catd-ledger-row.is-bare { grid-template-columns: minmax(5.5rem, max-content) 1fr; }

.catd-ledger-num {
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.1;
	color: var(--text-heading);
	text-align: right;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.01em;
}
.catd-ledger-meta { min-width: 0; }
.catd-ledger-title {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--text-heading);
	line-height: 1.25;
}
.catd-ledger-desc {
	font-size: 0.82rem;
	color: var(--text-secondary);
	margin-top: 0.15rem;
	line-height: 1.4;
}
.catd-ledger-desc a {
	color: var(--primary);
	font-weight: 500;
	text-decoration: none;
}
.catd-ledger-desc a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }
.catd-ledger-aside { display: inline; }
.catd-ledger-aside strong { color: var(--text-heading); font-weight: 600; font-variant-numeric: tabular-nums; }
.catd-ledger-controls {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	white-space: nowrap;
}

@media (max-width: 640px) {
	.catd-ledger-row {
		grid-template-columns: minmax(4rem, max-content) 1fr;
		grid-template-areas:
			"num meta"
			"ctl ctl";
		row-gap: 0.65rem;
	}
	.catd-ledger-row.is-bare { grid-template-areas: "num meta"; }
	.catd-ledger-num { grid-area: num; }
	.catd-ledger-meta { grid-area: meta; }
	.catd-ledger-controls { grid-area: ctl; justify-content: flex-end; }
}

/* ---- Status chip (inline indicator) ----
   A compact, color-only signal: small icon + label, bordered, white background.
   Status color paints the text and icon - never the chip fill. Used by the
   system-overview header and the reconciliation card. */
.catd-status {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.25rem 0.6rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--card);
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--text-secondary);
	line-height: 1.2;
	white-space: nowrap;
}
.catd-status svg { width: 0.9rem; height: 0.9rem; flex-shrink: 0; }
.catd-status.is-ok { color: var(--success); }
.catd-status.is-warn { color: #b3261e; }
.catd-status.is-neutral { color: var(--text-secondary); }

/* ---- Overview-mode card (full-bleed ledger card) ----
   A card stripped of its padding so a header strip + ledger fill it edge to
   edge. Used by the dashboard cards where the data IS the card and there's no
   surrounding form chrome. The card's own border-radius shapes the whole
   assembly; the inner ledger drops its border to avoid doubling. */
.catd-card.catd-overview { padding: 0; overflow: hidden; }
.catd-card.catd-overview .catd-ledger { border: 0; border-radius: 0; }

.catd-overview-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem 1rem;
	flex-wrap: wrap;
	padding: 0.8rem 1.15rem;
	border-bottom: 1px solid var(--border);
	background: var(--card);
}
.catd-overview-head .catd-section-title { margin: 0; }
/* Push status to the right of the head, sitting before any trailing chevron. */
.catd-overview-head .catd-status { margin-left: auto; }

/* Reconciliation card: the collapsible head uses the overview strip; the body's
   inner container drops its top padding so the ledger sits flush under the head. */
.catd-card.catd-overview .catd-collapsible.is-open .catd-collapsible-inner,
.catd-card.catd-overview .catd-collapsible-inner { padding: 0; }
.catd-recon-foot {
	margin: 0;
	padding: 0.55rem 1.15rem 0.75rem;
	font-size: 0.78rem;
	color: var(--text-secondary);
	border-top: 1px solid var(--border);
}

/* Empty state inside a full-bleed overview card (the outer card has no padding,
   so the message brings its own). */
.catd-card.catd-overview .catd-empty {
	margin: 0;
	padding: 1rem 1.15rem;
	color: var(--text-secondary);
	font-size: 0.88rem;
}

/* Small text link below an export form (used by Pe etapă: "Detalii și data citirii"). */
.catd-hub-foot {
	margin: 0.6rem 0 0;
	font-size: 0.82rem;
}
.catd-hub-foot a {
	color: var(--primary);
	font-weight: 500;
	text-decoration: none;
}
.catd-hub-foot a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }
.catd-overview-meta {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.85rem;
	color: var(--text-secondary);
}
.catd-overview-meta strong {
	color: var(--text-heading);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.catd-overview-meta svg { color: var(--text-secondary); flex-shrink: 0; }

/* ---- General-export feature-specific controls ----
   Inclusion checkbox + "Doar acestea" inline link, plus the CTA bar and
   running/details disclosure - these are export-only. */
.catd-genexp-intro { margin-bottom: 1rem; }
.catd-genexp-state {
	font-size: 0.78rem;
	color: var(--text-secondary);
	letter-spacing: 0.01em;
}
.catd-genexp-inc {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--text-body);
	cursor: pointer;
	user-select: none;
}
.catd-genexp-inc input[type="checkbox"] {
	width: 1rem;
	height: 1rem;
	accent-color: var(--primary);
	cursor: pointer;
}
.catd-genexp-only {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	background: none;
	border: 0;
	padding: 0.15rem 0.1rem;
	font: inherit;
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--primary);
	cursor: pointer;
}
.catd-genexp-only:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }
.catd-genexp-only:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
	border-radius: 4px;
}
.catd-genexp-only:disabled {
	color: var(--text-secondary);
	opacity: 0.5;
	cursor: not-allowed;
	text-decoration: none;
}

/* CTA bar: the live count carries the decision; the format toggle and the
   button sit on the right at equal weight to one another. */
.catd-genexp-cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1rem;
	margin-top: 1.1rem;
}
.catd-genexp-summary {
	margin: 0;
	font-size: 0.95rem;
	color: var(--text-secondary);
}
.catd-genexp-summary strong {
	color: var(--text-heading);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.catd-genexp-cta-controls {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex-wrap: wrap;
}

/* Running state: keep the ledger visible above; show the progress strip below
   the CTA bar with the log tucked behind a disclosure (closed by default). */
.catd-genexp-progress { margin-top: 1rem; }
.catd-genexp-details { margin-top: 0.5rem; }
.catd-genexp-details > summary {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--text-secondary);
	cursor: pointer;
	list-style: none;
	padding: 0.15rem 0.2rem;
	border-radius: 4px;
}
.catd-genexp-details > summary::-webkit-details-marker { display: none; }
.catd-genexp-details > summary::before {
	content: '';
	display: inline-block;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 4px 0 4px 6px;
	border-color: transparent transparent transparent currentColor;
	transition: transform 0.15s ease;
}
.catd-genexp-details[open] > summary::before { transform: rotate(90deg); }
.catd-genexp-details > summary:hover { color: var(--text-heading); }
.catd-genexp-details > .catd-sync-log { margin-top: 0.5rem; }

/* While an export is running, dim the ledger controls but keep the numbers
   readable as context. */
.catd-ledger.is-busy .catd-ledger-controls { opacity: 0.4; pointer-events: none; }

@media (max-width: 640px) {
	.catd-genexp-cta { flex-direction: column; align-items: stretch; }
	.catd-genexp-cta-controls { justify-content: space-between; }
}

/* ---- City/category export component ---- */
.catd-cityexp-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.6rem 1.1rem;
	margin-bottom: 0.9rem;
}
.catd-cityexp-field { display: flex; flex-direction: column; gap: 0.3rem; }
.catd-cityexp-field .catd-label { margin: 0; }
/* mode + format as bordered inline groups */
.catd-cityexp-mode .catd-radio-group,
.catd-cityexp-fmt {
	display: inline-flex;
	gap: 0.85rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-button);
	padding: 0.4rem 0.7rem;
}
.catd-cityexp-mode .catd-radio-group label,
.catd-cityexp-fmt label {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.83rem;
	font-weight: 600;
	color: var(--text-body);
	cursor: pointer;
	margin: 0;
}
/* category buttons as chips */
.catd-cityexp-cats { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.catd-cityexp-cats .catd-btn { padding: 0.4rem 0.75rem; font-size: 0.82rem; }
/* restrained warning note (not a full red alert block) */
.catd-note {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-size: 0.82rem;
	color: var(--text-body);
	background: #fff8e6;
	border: 1px solid #f0d68a;
	border-radius: var(--radius-button);
	padding: 0.5rem 0.7rem;
}
.catd-note svg { flex: none; width: 1rem; height: 1rem; color: #b8860b; margin-top: 0.05rem; }
.catd-cityexp-asoc-note { margin: 0.7rem 0 0; }

/* ============================================================
   Dashboard layout: health strip + hero overview
   Used by the Departament intern panel (view=dashboard).
   ============================================================ */

/* ---- Health strip: slim, single-line sync + reconciliation status ---- */
.catd-health-strip {
	padding: 0.65rem 1.1rem;
}
.catd-health-strip.catd-collapsible.is-open { padding-bottom: 1rem; }

.catd-health-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.9rem;
	width: 100%;
	box-sizing: border-box;
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	color: var(--text-body);
	text-align: left;
}
button.catd-health-head { cursor: pointer; }

.catd-health-sync {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.85rem;
	color: var(--text-secondary);
	min-width: 0;
}
.catd-health-sync svg { color: var(--text-secondary); flex-shrink: 0; }
.catd-health-sync strong {
	color: var(--text-heading);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.catd-health-strip .catd-status {
	margin-left: auto;
	font-size: 0.85rem;
}
.catd-health-strip .catd-collapsible-chevron { flex: none; }

/* Reconciliation detail area, only rendered when the strip is collapsible */
.catd-health-strip.catd-collapsible.is-open .catd-collapsible-inner,
.catd-health-strip .catd-collapsible-inner { padding: 0; }
.catd-health-recon {
	padding-top: 0.65rem;
	border-top: 1px solid var(--border);
	margin-top: 0.65rem;
}
.catd-health-recon .catd-ledger { border: 0; border-radius: 0; }

/* ---- Hero overview: two big totals, horizontal ---- */
.catd-hero {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem 2.5rem;
	padding: 1.75rem 1.75rem 1.6rem;
	align-items: start;
}
.catd-hero-col { min-width: 0; }

.catd-hero-num {
	font-size: clamp(1.6rem, 2.6vw, 1.95rem);
	line-height: 1.1;
	font-weight: 700;
	color: var(--text-heading);
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.01em;
	margin-bottom: 0.2rem;
}

.catd-hero-label {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--text-secondary);
	margin-bottom: 0.95rem;
}

.catd-hero-sub {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	font-size: 0.92rem;
	color: var(--text-body);
}
.catd-hero-sub strong {
	color: var(--text-heading);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* Inline anomaly note: subtle warning, only renders when counts > 0 */
.catd-hero-anomaly {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	margin-left: 0.5rem;
	font-size: 0.82rem;
	color: #b3261e;
}
.catd-hero-anomaly svg {
	width: 0.9rem;
	height: 0.9rem;
	flex-shrink: 0;
}

@media (max-width: 720px) {
	.catd-hero {
		grid-template-columns: 1fr;
		gap: 1.4rem;
		padding: 1.4rem 1.25rem;
	}
	.catd-hero-num { font-size: 1.7rem; }
	.catd-hero-anomaly {
		display: flex;
		margin-left: 0;
		margin-top: 0.2rem;
	}
}

/* ============================================================
   Material Symbols icons
   Real icon glyphs replacing the old hand-built inline SVGs.
   Sized per context via font-size; colour follows currentColor.
   ============================================================ */
.material-symbols-outlined {
	font-family: 'Material Symbols Outlined';
	font-weight: normal;
	font-style: normal;
	font-size: 1.25rem;
	line-height: 1;
	letter-spacing: normal;
	display: inline-flex;
	flex: none;
	vertical-align: middle;
	white-space: nowrap;
	direction: ltr;
	-webkit-font-feature-settings: 'liga';
	-webkit-font-smoothing: antialiased;
	-webkit-user-select: none;
	user-select: none;
	font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

/* Leading icon on a section heading or collapsible title */
.catd-section-title.catd-has-ico { display: flex; align-items: center; gap: 0.45rem; }
.catd-title-ico { font-size: 1.2rem; color: var(--text-secondary); }

/* Tab icon (e.g. the Asociații nav tab) */
.catd-int-tab .catd-tab-ico { font-size: 1.15rem; }

/* Hero total: a filled accent glyph sized to sit beside the big number */
.catd-hero-num { display: flex; align-items: center; gap: 0.55rem; }
.catd-hero-ico {
	font-size: 1.75rem;
	color: var(--primary);
	font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

/* Health strip "Sincronizat" glyph — a touch larger than the old 14px SVG */
.catd-health-sync .catd-health-sync-ico { font-size: 1.25rem; color: var(--text-secondary); }

/* Button-leading icons keep close to the old 16px SVG footprint */
.catd-btn .material-symbols-outlined { font-size: 1.15rem; }
.catd-genexp-only .material-symbols-outlined { font-size: 1rem; }
.catd-status .material-symbols-outlined { font-size: 1.05rem; }
.catd-hero-anomaly .material-symbols-outlined { font-size: 1rem; }
.catd-menu-item .material-symbols-outlined { font-size: 1.2rem; }
.catd-modal-close .material-symbols-outlined { font-size: 1.3rem; }

/* Readings page: inline accent glyph + large empty-state glyph */
.catd-icon { font-size: 1.15rem; }
.catd-empty .catd-icon { font-size: 2.2rem; }

/* Appbar account button: avatar + rotating caret (the caret rule carries the
   higher specificity so it wins over the avatar rule on the same element type) */
.catd-appbar-user .material-symbols-outlined { font-size: 1.2rem; }
.catd-appbar-user .catd-appbar-user-caret { font-size: 0.95rem; }

/* Association row expander chevron (rotation rule targets the class) */
.catd-assoc-toggle .catd-assoc-chev { font-size: 1.1rem; }

/* Per-row table action buttons (download / busy) */
.catd-btn-table .material-symbols-outlined { font-size: 1.05rem; }

/* Inline note glyph keeps its amber tone */
.catd-note .material-symbols-outlined { font-size: 1rem; color: #b8860b; }

/* Registration Flow Tabs */
.catd-auth-tabs {
	display: flex;
	border-bottom: 1px solid var(--border, #d2dbe2);
	margin: -1.5rem -1.25rem 1.5rem -1.25rem;
	overflow: hidden;
	border-top-left-radius: inherit;
	border-top-right-radius: inherit;
}
.catd-auth-tab {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	padding: 0.75rem 0.5rem;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--text-body, #2C3E50);
	text-decoration: none;
	text-align: center;
	border-bottom: 2px solid transparent;
	transition: all 0.2s ease;
}
.catd-auth-tab:hover {
	color: var(--color-primary, #0278C0);
	background: rgba(2, 120, 192, 0.03);
}
.catd-auth-tab.is-active {
	color: var(--color-primary, #0278C0);
	border-bottom-color: var(--color-primary, #0278C0);
	font-weight: 600;
	background: rgba(2, 120, 192, 0.05);
}
.catd-auth-tab .material-symbols-outlined {
	font-size: 1.5rem;
}

/* Help Modal Tabs */
.catd-help-tabs {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid var(--border, #d2dbe2);
	padding-bottom: 0.5rem;
}
.catd-help-tab {
	background: none;
	border: none;
	padding: 0.5rem 1rem;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--text-body, #2C3E50);
	cursor: pointer;
	border-bottom: 2px solid transparent;
	transition: all 0.2s ease;
}
.catd-help-tab:hover {
	color: var(--color-primary, #0278C0);
}
.catd-help-tab.is-active {
	color: var(--color-primary, #0278C0);
	border-bottom-color: var(--color-primary, #0278C0);
	font-weight: 600;
}

