/* Interfaces hors calendrier : même langue visuelle que l'Herbier (papier, filets gravés, encre verte). */
:root {
	--papier: #c4f1ffc4;
	--cuvette: #E4E7E0;
	--etiquette: #88c2d1;
	--encre: #1F3327;
	--encre_light: #32523f;
	--encre-2: #5C7462;
	--lavis: #8FA68E;
	--baie: #B1262E;
	--pose: .5px 1px 0 rgba(31, 51, 39, .17), 0 1px 1.5px rgba(31, 51, 39, .09);
	color-scheme: light;
}
*, *::before, *::after {
	box-sizing: border-box;
}

html {
	background: var(--papier);
	color: var(--encre);
	font-family: 'IM Fell English', serif;
	font-size: 18px;
	line-height: 1.45;
	-webkit-text-size-adjust: 100%;
}
body {
	margin: 0;
	min-height: 100vh;
}

h1, h2, h3 {
	font-weight: normal;
	margin: 0;
	line-height: 1.15;
}

h1 {
	font-size: 2rem;
}

h2 {
	font-family: 'IM Fell English SC', serif;
	font-size: 1.25rem;
	letter-spacing: .08em;
}

h3 {
	font-size: 1.05rem;
	font-style: italic;
}

p {
	margin: 0 0 .6em;
}

a {
	color: var(--encre);
	text-underline-offset: 3px;
}

a:hover {
	color: var(--encre-2);
}

:focus {
	outline: none;
}

:focus-visible {
	outline: 1px solid var(--baie);
	outline-offset: 3px;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

[hidden] {
	display: none !important;
}

.sec {
	color: var(--encre-2);
}

.petit {
	font-size: .85rem;
}

/* En-tête d'administration */
.entete {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 20px;
	padding: 6px 16px;
	border-bottom: 1px solid var(--encre);
	box-shadow: 0 3px 0 var(--papier), 0 4px 0 rgba(92, 116, 98, .5);
	background: var(--etiquette);
}

.entete .marque {
	font-size: 1.2rem;
	font-style: italic;
	text-decoration: none;
	padding: 10px 0;
}

.entete nav {
	display: flex;
	flex-wrap: wrap;
}

.entete nav a, .entete nav button {
	appearance: none;
	border: 0;
	background: none;
	font: inherit;
	color: var(--encre-2);
	text-decoration: none;
	cursor: pointer;
	font-family: 'IM Fell English SC', serif;
	letter-spacing: .08em;
	font-size: .9rem;
	min-height: 44px; 
	padding: 0 12px; 
	display: inline-flex; 
	align-items: center;
}

.entete nav a:hover, .entete nav button:hover, .entete nav [aria-current] {
	color: var(--encre);
}

.entete nav [aria-current] {
	box-shadow: inset 0 -2px 0 var(--encre);
}

.entete nav :focus-visible {
	outline-offset: -6px;
}

/* Mise en page */
.page {
	max-width: 62rem;
	margin: 0 auto;
	padding: 24px 16px 64px;
	display: grid;
	gap: 28px;
}

.page.etroit {
	max-width: 28rem;
}

.titre-page {
	display: grid;
	gap: 6px;
}

.filet {
	display: block;
	width: 132px;
	height: 8px;
}

.filet-wrap {
	display: block;
}

/* Planche : panneau gravé (filet gras + filet fin) */
.planche-ap {
	position: relative; 
	background: var(--etiquette); 
	box-shadow: var(--pose);
	padding: 22px 20px 24px; 
	display: grid;
	gap: 14px; 
	align-content: start;
	border: 1.3px solid var(--encre); 
	outline: .7px solid var(--encre); 
	outline-offset: 3px;
	margin: 4px;
	box-shadow: 0 0 10px rgb(255, 255, 255);
}

.planche-ap > h2 {
	display: flex; 
	align-items: center; 
	gap: 10px; 
}

.grille {
	display: grid; 
	gap: 22px; 
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}

.planche-ap.carte {
	text-decoration: none; 
	color: inherit; 
	transition: translate 120ms cubic-bezier(.2, .6, .3, 1);
}

a.planche-ap.carte:hover {
	translate: 0 -1px; 
	box-shadow: 1px 2.5px 1.5px rgba(31, 51, 39, .16), .5px 3.5px 4px rgba(31, 51, 39, .07);
}

.carte .nom-carte {
	font-size: 1.5rem;
	line-height: 1.1;
}

.carte .annee {
	font-family: 'IM Fell English SC', serif;
	letter-spacing: .09em;
	color: var(--encre-2);
}

/* Formulaires */
form {
	display: grid;
	gap: 14px;
}

/* #username, #password {
	box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.25);
} */

.champ {
	display: grid;
	gap: 4px;
}

.champ label, .champ .lib {
	font-family: 'IM Fell English SC', serif;
	letter-spacing: .08em;
	font-size: .85rem;
	color: var(--encre-2);
}

input[type=text], input[type=password], input[type=number], select {
	font: inherit;
	color: inherit;
	width: 100%;
	min-height: 44px;
	padding: 6px 10px;
	background: var(--cuvette);
	border: 1px solid var(--encre-2);
	border-radius: 0;
	box-shadow: inset 1px 1.5px 2px rgba(31, 51, 39, .12);
	box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.25);
}

input:focus-visible, select:focus-visible {
	outline: 1px solid var(--baie);
	outline-offset: 2px;
	border-color: var(--encre);
}

input:disabled, select:disabled {
	opacity: .55;
}

.rangee {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 14px;
	align-items: end;
}

.rangee > .champ {
	flex: 1 1 11rem;
}

.case {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	cursor: pointer;
}

.case input {
	width: 20px;
	height: 20px;
	accent-color: var(--encre);
	flex: none;
}

.case:has(input:focus-visible) {
	outline: 1px solid var(--baie);
	outline-offset: 2px;
}

/* Boutons sobres */
.btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 44px;
	padding: 4px 16px 5px;
	border: 1px solid var(--encre);
	border-radius: 0;
	background: var(--etiquette);
	color: var(--encre);
	font: inherit;
	font-family: 'IM Fell English SC', serif;
	letter-spacing: .09em;
	font-size: .9rem;
	text-decoration: none;
	cursor: pointer;
	box-shadow: var(--pose);
	transition: background-color 120ms, color 120ms;
}

.btn:hover:not(:disabled) {
	background: var(--papier);
	color: var(--encre_light);
}

.btn:disabled {
	opacity: .5;
	cursor: default;
}

.btn.discret {
	border-color: transparent;
	box-shadow: none;
	background: none;
	color: var(--encre-2);
	text-decoration: underline;
	text-underline-offset: 3px;
	min-height: 44px;
}

.btn.discret:hover:not(:disabled) {
	background: none;
	color: var(--encre);
}

.btn.danger {
	border-color: var(--baie);
	color: var(--baie);
}

.btn.danger:hover:not(:disabled) {
	background: var(--baie);
	color: var(--etiquette);
}

.btn.petit {
	min-height: 44px;
	padding: 2px 12px;
	font-size: .8rem;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

/* Messages */
.message-zone {
	margin: 0;
	padding: 8px 14px 10px;
	font-style: italic;
	border-left: 3px solid var(--encre-2);
	background: var(--etiquette);
}

.message-zone.erreur {
	border-left-color: var(--baie);
	color: var(--baie);
}

.vide {
	font-style: italic;
	color: var(--encre-2);
}

/* Listes */
.liste {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
}

.liste > li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 14px;
	justify-content: space-between;
	padding: 6px 0;
	border-bottom: .5px solid var(--lavis);
}

.liste > li:last-child {
	border-bottom: 0;
}

.liste .qui {
	display: grid;
	min-width: 0;
	overflow-wrap: anywhere;
}

.pastille {
	font-family: 'IM Fell English SC', serif;
	font-size: .75rem;
	letter-spacing: .08em;
	border: .5px solid var(--encre-2);
	padding: 0 6px;
	color: var(--encre-2);
	margin-left: 6px;
}

.pastille.alerte {
	border-color: var(--baie);
	color: var(--baie);
}

/* Tableau (journal) */
.tableau { overflow-x: auto; }
table {
	border-collapse: collapse;
	width: 100%;
	font-size: .9rem;
}

th {
	font-family: 'IM Fell English SC', serif;
	letter-spacing: .08em;
	font-weight: normal;
	text-align: left;
	color: var(--encre-2);
	border-bottom: 1px solid var(--encre);
	padding: 4px 10px 4px 0;
	white-space: nowrap;
}

td {
	padding: 6px 10px 6px 0;
	border-bottom: .5px solid var(--lavis);
	vertical-align: top;
}

td.ua {
	max-width: 22rem;
	overflow-wrap: anywhere;
	color: var(--encre-2);
}

/* 24 emplacements */
.emplacements {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5rem), 1fr));
}

.emp {
	display: grid;
	gap: 8px;
	align-content: start;
	padding: 10px;
	background: var(--papier);
	border: .5px solid var(--encre-2);
}

.emp.armee {
	outline: 1px solid var(--baie);
	outline-offset: 2px;
}

.emp .num {
	font-style: italic;
	font-size: 1.4rem;
	line-height: 1;
}

.emp .vignette {
	aspect-ratio: 4 / 3;
	background: var(--cuvette);
	box-shadow: inset 1px 1.5px 2px rgba(31, 51, 39, .28);
	display: grid;
	place-items: center;
	text-align: center;
	font-size: .8rem;
	font-style: italic;
	color: var(--encre-2);
	overflow: hidden;
	padding: 4px;
}

.emp .vignette img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.emp .boutons {
	display: grid;
	gap: 4px;
}

.emp .btn {
	width: 100%;
}

.emp label.btn {
	position: relative;
}

.emp input[type=file] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.emp label.btn:has(input:focus-visible) {
	outline: 1px solid var(--baie);
	outline-offset: 2px;
}

/* Visiteurs */
.visiteur {
	display: grid;
	gap: 10px;
	padding: 12px 0;
	border-bottom: .5px solid var(--lavis);
}

.visiteur:last-child {
	border-bottom: 0;
}

.visiteur .tete {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	align-items: baseline;
	justify-content: space-between;
}

.visiteur fieldset {
	border: 0;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 0 20px;
	grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

.visiteur legend {
	padding: 0;
	font-family: 'IM Fell English SC', serif;
	letter-spacing: .08em;
	font-size: .85rem;
	color: var(--encre-2);
}

details > summary {
	cursor: pointer;
	min-height: 44px;
	display: flex;
	align-items: center;
	font-family: 'IM Fell English SC', serif;
	letter-spacing: .08em;
}

details > summary:focus-visible {
	outline: 1px solid var(--baie);
	outline-offset: -2px;
}

@media (min-width: 720px) {
	.planche-ap {padding: 26px 30px 30px; } 
}

@media (prefers-reduced-motion: reduce) {
	.btn, .planche-ap.carte { transition: none; }
	a.planche-ap.carte:hover { translate: none; }
}

fieldset.champ {
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
}

/* Sélecteur de thème dans l’administration */
.selecteur-themes {
	border: 0;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 8px;
}

.selecteur-themes > legend {
	padding: 0;
	font-family: 'IM Fell English SC', serif;
	letter-spacing: .08em;
	font-size: .85rem;
	color: var(--encre-2);
}

.grille-themes {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr));
}

.theme-carte {
	position: relative;
	display: grid;
	gap: 8px;
	align-content: start;
	padding: 12px 13px;
	background: var(--cuvette);
	border: 1px solid var(--lavis);
	cursor: pointer;
	transition: border-color 120ms ease, background-color 120ms ease;
}

.theme-carte:hover {
	border-color: var(--encre);
}

.theme-carte.selectionne {
	border: 1.3px solid var(--encre);
	outline: 1px solid var(--baie);
	outline-offset: -4px;
	background: #F4F5F1;
}

.theme-carte input[type=radio] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.theme-carte:has(input[type=radio]:focus-visible) {
	outline: 1.5px solid var(--baie);
	outline-offset: 2px;
}

.theme-apercu {
	display: grid;
	grid-template-columns: 1.5fr 1.2fr 1fr .6fr;
	height: 22px;
	border: 1px solid rgba(31, 51, 39, .35);
	overflow: hidden;
}

.theme-pastille {
	display: block;
	height: 100%;
}

.theme-pastille.p1 { background: var(--cuvette); }
.theme-pastille.p2 { background: var(--etiquette); }
.theme-pastille.p3 { background: var(--papier); }
.theme-pastille.p4 { background: var(--baie); }

.theme-texte {
	display: grid;
	gap: 3px;
}

.theme-nom {
	font-family: 'IM Fell English SC', serif;
	letter-spacing: .06em;
	font-size: .95rem;
	color: var(--encre);
}

.theme-desc {
	font-size: .84rem;
	font-style: italic;
	line-height: 1.3;
	color: var(--encre-2);
}
