/* Painel /gestao-projetos — ferramenta interna, estilo simples e
   funcional (não o template cinético da marca), com a paleta ink/paper só
   como toque de identidade (fundo/texto/acento). */

:root {
	--pv-ink: #282040;
	--pv-paper: #f0e8e0;
	--pv-accent: #c9a24c;
	--pv-danger: #a4402f;
	--pv-border: #d8cfc4;
}

* { box-sizing: border-box; }

body.pv-panel-body {
	margin: 0;
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	background: #faf7f3;
	color: var(--pv-ink);
	line-height: 1.5;
}

/* --- Ecrã de login / sem permissão --- */
.pv-auth-screen {
	min-height: 100vh;
	display: grid;
	place-items: center;
	background: var(--pv-ink);
	padding: 2rem;
}
.pv-auth-card {
	background: var(--pv-paper);
	border-radius: 0.75rem;
	padding: 2.5rem;
	max-width: 24rem;
	width: 100%;
	box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.35);
}
.pv-auth-card h1 { margin-top: 0; font-size: 1.4rem; }
.pv-auth-card form p { margin: 0.75rem 0; }
.pv-auth-card input[type="text"],
.pv-auth-card input[type="password"] {
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--pv-border);
	border-radius: 0.4rem;
	font-size: 1rem;
}
.pv-auth-card input[type="submit"] {
	background: var(--pv-ink);
	color: var(--pv-paper);
	border: none;
	border-radius: 0.4rem;
	padding: 0.6rem 1.2rem;
	font-weight: 600;
	cursor: pointer;
}

/* --- Painel --- */
.pv-panel { max-width: 62rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.pv-panel__header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 2rem;
	flex-wrap: wrap;
}
.pv-panel__header h1 { margin: 0 0 0.25rem; font-size: 1.6rem; }
.pv-panel__subtitle { margin: 0; color: #6b6478; font-size: 0.9rem; }
.pv-panel__account { text-align: right; font-size: 0.9rem; }
.pv-panel__account a { color: var(--pv-ink); }

.pv-hint { color: #6b6478; font-size: 0.9rem; }
.pv-hint-inline { font-weight: 400; color: #6b6478; font-size: 0.85rem; }

.pv-view__toolbar { margin-bottom: 1rem; display: flex; justify-content: space-between; }

.pv-btn {
	appearance: none;
	border: 1px solid var(--pv-ink);
	background: transparent;
	color: var(--pv-ink);
	padding: 0.55rem 1.1rem;
	border-radius: 999px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
}
.pv-btn:hover { background: rgba(40, 32, 64, 0.06); }
.pv-btn--primary { background: var(--pv-ink); color: var(--pv-paper); }
.pv-btn--primary:hover { background: #38304f; }
.pv-btn--danger { border-color: var(--pv-danger); color: var(--pv-danger); }
.pv-btn--danger:hover { background: rgba(164, 64, 47, 0.08); }

/* --- Lista de projetos --- */
.pv-project-list { display: flex; flex-direction: column; gap: 0.6rem; }
.pv-project-row {
	display: flex;
	align-items: center;
	gap: 1rem;
	background: #fff;
	border: 1px solid var(--pv-border);
	border-radius: 0.6rem;
	padding: 0.6rem 0.9rem;
}
.pv-project-row__cover {
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 0.4rem;
	object-fit: cover;
	background: var(--pv-border);
	flex-shrink: 0;
}
.pv-project-row__body { flex: 1; min-width: 0; }
.pv-project-row__title { font-weight: 600; }
.pv-project-row__meta { font-size: 0.82rem; color: #6b6478; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pv-badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.pv-badge--publish { background: #dcefe0; color: #2b6b3f; }
.pv-badge--draft { background: #ede6da; color: #7a6a4a; }
.pv-badge--featured { background: rgba(201, 162, 76, 0.2); color: #7a5f1f; }
.pv-project-row__actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* --- Formulário --- */
.pv-field { display: block; margin-bottom: 1.1rem; }
.pv-field > span, .pv-field legend { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.35rem; }
.pv-field input[type="text"],
.pv-field textarea,
.pv-field select {
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--pv-border);
	border-radius: 0.4rem;
	font-size: 0.95rem;
	font-family: inherit;
}
.pv-field--inline { display: flex; align-items: center; gap: 0.5rem; }
.pv-field--inline > span { margin: 0; }
.pv-field--inline input[type="checkbox"] { width: auto; }
.pv-field--inline select { width: auto; }

.pv-checkbox-list { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.pv-checkbox-list label { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; font-size: 0.9rem; }

.pv-gallery { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.6rem; }
.pv-gallery__item {
	position: relative;
	width: 6rem;
	height: 6rem;
	border-radius: 0.4rem;
	overflow: hidden;
	border: 2px solid transparent;
	cursor: grab;
}
.pv-gallery__item.is-cover { border-color: var(--pv-accent); }
.pv-gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-gallery__item .pv-gallery__cover-label {
	position: absolute; top: 0; left: 0; right: 0;
	background: rgba(201, 162, 76, 0.9);
	color: #2a2010;
	font-size: 0.65rem;
	font-weight: 700;
	text-align: center;
	padding: 0.1rem 0;
}
.pv-gallery__item .pv-gallery__remove {
	position: absolute; top: 0.2rem; right: 0.2rem;
	width: 1.3rem; height: 1.3rem;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	line-height: 1;
	cursor: pointer;
}
.pv-gallery__uploading { opacity: 0.5; }

.pv-form-actions { display: flex; gap: 0.6rem; margin-top: 1.5rem; }
.pv-field-error { color: var(--pv-danger); font-size: 0.88rem; margin-top: 0.4rem; }

.pv-loading { color: #6b6478; }

/* --- Destaques da home --- */
.pv-featured-selected {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	min-height: 5rem;
	margin: 1rem 0 1.5rem;
	padding: 0.75rem;
	border: 1.5px dashed var(--pv-border);
	border-radius: 0.5rem;
}
.pv-featured-selected__item {
	position: relative;
	width: 5.5rem;
	height: 5.5rem;
	border-radius: 0.4rem;
	overflow: hidden;
	cursor: grab;
	border: 2px solid var(--pv-accent);
}
.pv-featured-selected__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-featured-selected__order {
	position: absolute; top: 0.2rem; left: 0.2rem;
	min-width: 1.2rem; height: 1.2rem; padding: 0 0.25rem;
	display: grid; place-items: center;
	border-radius: 999px;
	background: var(--pv-ink); color: #fff;
	font-size: 0.7rem; font-weight: 700;
}

.pv-featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 0.75rem; }
.pv-featured-grid__item {
	position: relative;
	display: block;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 0.5rem;
	overflow: hidden;
	background: #fff;
	cursor: pointer;
	text-align: left;
}
.pv-featured-grid__item img { width: 100%; height: 6rem; object-fit: cover; display: block; }
.pv-featured-grid__label {
	display: block;
	padding: 0.3rem 0.5rem;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--pv-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.pv-featured-grid__item.is-selected { border-color: var(--pv-accent); }
.pv-featured-grid__item.is-selected::after {
	content: '✓';
	position: absolute; top: 0.3rem; right: 0.3rem;
	width: 1.3rem; height: 1.3rem;
	display: grid; place-items: center;
	border-radius: 50%;
	background: var(--pv-accent); color: #2a2010;
	font-size: 0.8rem; font-weight: 700;
}
