/* ================================================================
   Tabela limpa (estilo shadcn) — usada em /vizinhos.
   Cabeçalho ordenável, linhas verticais entre colunas, e realce ao
   passar o rato. A minha casa fica destacada em permanência.
   ================================================================ */
.sf-table-wrap {
	border: 1px solid var(--border);
	border-radius: 0.75rem;
	overflow-x: auto;
}

.sf-table {
	inline-size: 100%;
	border-collapse: collapse;
	text-align: start;
	font-size: 0.875rem;
}

.sf-table thead tr {
	border-block-end: 1px solid var(--border);
}

/* A sombra vive só no cabeçalho, em todas as células — nunca nas linhas. */
.sf-table thead th {
	background-color: var(--muted);
}

/* Linhas verticais entre colunas (cabeçalho e corpo). */
.sf-table th,
.sf-table td {
	border-inline-end: 1px solid var(--border);
	vertical-align: middle;
	white-space: nowrap;
}

.sf-table th:last-child,
.sf-table td:last-child {
	border-inline-end: none;
}

.sf-table th {
	/* Clonado do bloco data-table-sorting: padding espaçoso igual ao das
	   células — nada de altura fixa a espremer o cabeçalho. */
	padding: 0.75rem 1rem;
	font-weight: 600;
	color: var(--muted-fg);
	text-align: start;
}

.sf-table th[data-key] {
	cursor: pointer;
	user-select: none;
	transition: color 0.15s ease;
}

.sf-table th[data-key]:hover {
	color: var(--foreground);
}

.sf-table tbody tr {
	border-block-end: 1px solid var(--border);
}

.sf-table tbody tr:last-child {
	border-block-end: none;
}

/* Hover nas linhas, como no data-table-sorting. */
.sf-table tbody tr:hover {
	background-color: var(--muted);
}

.sf-table td {
	padding: 0.75rem 1rem;
}

/* Conteúdo do cabeçalho + seta de ordenação. */
.sf-th {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	inline-size: 100%;
}

.sf-th--right {
	justify-content: flex-end;
}

.sf-sort {
	font-size: 0.75rem;
	opacity: 0.3;
	transition: opacity 0.15s ease;
}

.sf-table th[data-sorted='true'] .sf-sort {
	opacity: 1;
	color: var(--foreground);
}

.sf-table .sf-table__num {
	font-variant-numeric: tabular-nums;
}

.sf-table .text-right {
	text-align: end;
}

.sf-table tr.is-total {
	border-block-start: 1px solid var(--border);
	font-weight: 600;
}

/* Telemóvel: cada linha vira um cartão, para os controlos (casa, papel,
   acções) não ficarem fora do ecrã a exigir deslize lateral. */
@media (max-width: 640px) {
	.sf-table--cards thead {
		display: none;
	}

	.sf-table--cards tr {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.25rem 0.75rem;
		padding: 0.625rem 1rem;
	}

	.sf-table--cards td {
		display: block;
		padding: 0;
		border-inline-end: 0;
		white-space: normal;
	}

	.sf-table--cards td:nth-child(1) {
		flex: 1 1 100%;
		font-weight: 600;
	}

	.sf-table--cards td:nth-child(2) {
		flex: 1 1 100%;
		font-size: 0.75rem;
		color: var(--muted-fg);
		overflow-wrap: anywhere;
	}

	.sf-table--cards td:nth-child(3) {
		flex: 1 1 auto;
	}

	.sf-table--cards td:last-child {
		flex: 0 0 auto;
		margin-inline-start: auto;
	}
}

/* Seletor de casa, compacto (nas tabelas do Super admin). */
.sf-select {
	min-block-size: 2.25rem;
	border: 1px solid var(--border);
	border-radius: 0.5rem;
	padding: 0 0.5rem;
	font: inherit;
	font-size: 0.8125rem;
	background: var(--background);
	color: var(--foreground);
	max-inline-size: 9rem;
}

/* Upload: a seta sobe ao pairar (o ficheiro está a subir). */
.sf-upload-icon .sf-upload-icon__arrow {
	transition: transform 0.35s var(--ease-out-expo);
}

button:hover .sf-upload-icon__arrow {
	transform: translateY(-1.5px);
}

/* Armazenamento: a obturadora sobe ao pairar (a gaveta abre). */
.sf-floppy-icon .sf-floppy-icon__shutter {
	transition: transform 0.35s var(--ease-out-expo);
}

button:hover .sf-floppy-icon__shutter {
	transform: translateY(-1.5px);
}

/* Câmara: a lente aproxima ao pairar (a focar). */
.sf-camera-icon .sf-camera-icon__lens {
	transform-box: fill-box;
	transform-origin: center;
	transition: transform 0.35s var(--ease-out-expo);
}

button:hover .sf-camera-icon__lens {
	transform: scale(1.15);
}

/* Clipe (Carregar ficheiro): ao pairar o traço desenha-se sozinho
   (pathLength 1 normaliza o comprimento; o dashoffset faz a caneta). */
.sf-attach-icon .sf-attach-icon__path {
	stroke-dasharray: 1;
}

button:hover .sf-attach-icon__path {
	animation: sf-attach-draw 0.4s var(--ease-out-expo);
}

@keyframes sf-attach-draw {
	0% {
		stroke-dashoffset: 1;
		opacity: 0;
	}
	20% {
		opacity: 1;
	}
	100% {
		stroke-dashoffset: 0;
		opacity: 1;
	}
}

/* Menu da barra: as linhas juntam-se ao pairar (prévia de fechar). */
/* Condomínio (calendário): os dias pulsam ao pairar, um a um
   (o "animate" do motion, delay por ponto). */
.sf-calendar-icon .sf-calendar-icon__dot {
	fill: currentColor;
	stroke: none;
	transition: opacity 0.2s ease;
}

.nav-link:hover .sf-calendar-icon .sf-calendar-icon__dot {
	animation: sf-calendar-pulse 0.4s ease-out;
}

@keyframes sf-calendar-pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.3;
	}
}
