/**
 * Portail des écoles — l'ardoise.
 *
 * Le tableau de la classe : ardoise verte, menu écrit à la craie, cadre bois.
 * Les cases de saisie sont les seules surfaces claires de l'écran — ce sont
 * donc les seules qui appellent la main, ce qui règle la hiérarchie visuelle
 * sans avoir besoin de flèches ni de couleurs d'alerte.
 *
 * Monde volontairement unique : le portail ne suit pas le thème clair ou sombre
 * du système, il *est* une ardoise. Toutes les couleurs sont donc peintes
 * explicitement, et une feuille d'impression rebascule en clair pour ne pas
 * vider une cartouche à chaque bon de commande imprimé.
 *
 * Les couleurs et les polices viennent de la classe Branding, qui les injecte
 * en variables avant cette feuille. Les valeurs ci-dessous sont le repli.
 *
 * @package CuisineO\School
 */

:root {
	--cos-slate:       #2A4034;
	--cos-slate-deep:  #223528;
	--cos-slate-soft:  #32493C;
	--cos-slate-lift:  #3B5546;
	--cos-chalk:       #F4F1E4;
	--cos-chalk-dim:   #A9BCA9;
	--cos-chalk-faint: #7F9683;
	--cos-rule:        #4A6455;
	--cos-wood:        #8A6134;
	--cos-wood-light:  #A6763F;
	--cos-gold:        #F1B501;
	--cos-gold-deep:   #C99700;
	--cos-green:       #6ED09B;
	--cos-green-deep:  #00884D;
	--cos-red:         #E8776A;

	--cos-font-display: "Fredoka", "Trebuchet MS", sans-serif;
	--cos-font-body:    "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--cos-font-chalk:   "Dancing Script", "Segoe Script", cursive;
	--cos-font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	--cos-radius:    10px;
	--cos-radius-lg: 14px;
	--cos-pill:      999px;
}

*, *::before, *::after { box-sizing: border-box; }

.cos-body {
	margin: 0;
	background: var(--cos-slate);
	background-image:
		radial-gradient(900px 340px at 18% -4%, rgba(255, 255, 255, .05), transparent 62%),
		radial-gradient(760px 300px at 92% 104%, rgba(255, 255, 255, .035), transparent 58%);
	background-attachment: fixed;
	color: var(--cos-chalk);
	font-family: var(--cos-font-body);
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.cos-body :focus-visible {
	outline: 3px solid var(--cos-gold);
	outline-offset: 2px;
	border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
	.cos-body *, .cos-body *::before, .cos-body *::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}
}

.cos-sr {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* --- En-tête ------------------------------------------------------------ */

.cos-topbar {
	background: var(--cos-slate-deep);
	border-bottom: 3px solid var(--cos-wood);
	padding: 13px 22px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.cos-brand { display: flex; align-items: center; gap: 14px; }

.cos-logo { display: block; height: 40px; width: auto; }
.cos-logo--text {
	font-family: var(--cos-font-display);
	font-size: 22px;
	font-weight: 600;
	color: var(--cos-green);
	letter-spacing: -.01em;
}

.cos-brand em {
	font-style: normal;
	font-family: var(--cos-font-display);
	font-weight: 500;
	font-size: 12.5px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--cos-chalk-dim);
	border-left: 2px solid var(--cos-gold);
	padding-left: 14px;
}

.cos-account { display: flex; align-items: center; gap: 16px; font-size: 13.5px; color: var(--cos-chalk-dim); }
.cos-who { color: var(--cos-chalk); font-weight: 700; }
.cos-account a { color: var(--cos-chalk-dim); text-decoration: none; border-bottom: 2px solid var(--cos-gold); padding-bottom: 1px; }
.cos-account a:hover { color: var(--cos-gold); }

/* --- Corps -------------------------------------------------------------- */

.cos-main {
	max-width: 1180px;
	margin: 0 auto;
	padding: 26px 22px 52px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.cos-main h1 {
	font-family: var(--cos-font-chalk);
	font-weight: 700;
	font-size: clamp(34px, 5vw, 46px);
	line-height: 1.05;
	margin: 0;
	color: #FFFFFF;
	text-wrap: balance;
}

.cos-main h2 {
	font-family: var(--cos-font-display);
	font-weight: 600;
	font-size: 19px;
	letter-spacing: -.01em;
	margin: 0;
	color: var(--cos-chalk);
}

.cos-label {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--cos-chalk-faint);
}

.cos-lead { margin: 0; color: var(--cos-chalk-dim); }
.cos-muted { color: var(--cos-chalk-faint); font-size: 13.5px; }
.cos-muted a { color: var(--cos-gold); }
.cos-center { text-align: center; }

.cos-card {
	background: var(--cos-slate-deep);
	border: 1px solid var(--cos-rule);
	border-radius: var(--cos-radius-lg);
	padding: 26px 28px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* --- Écran de connexion -------------------------------------------------- */

.cos-login {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 20px;
}

.cos-login-card {
	width: 100%;
	max-width: 430px;
	background: var(--cos-slate-deep);
	border: 9px solid var(--cos-wood);
	border-radius: 10px;
	box-shadow: 0 26px 60px -34px rgba(0, 0, 0, .8);
	padding: 30px 28px 26px;
	display: flex;
	flex-direction: column;
	gap: 17px;
}

.cos-login-card .cos-logo { height: 50px; margin: 0 auto 2px; }
.cos-login-card .cos-logo--text { text-align: center; font-size: 26px; display: block; }

.cos-login-title {
	font-family: var(--cos-font-chalk);
	font-weight: 700;
	font-size: 33px;
	line-height: 1.1;
	margin: 0;
	text-align: center;
	color: #FFFFFF;
	text-wrap: balance;
}

.cos-login-sub {
	margin: -8px 0 0;
	text-align: center;
	font-size: 13.5px;
	color: var(--cos-chalk-dim);
	line-height: 1.45;
}

.cos-field { display: flex; flex-direction: column; gap: 6px; }
.cos-field label { font-size: 12.5px; font-weight: 800; color: var(--cos-chalk); letter-spacing: .02em; }

.cos-field input[type="text"],
.cos-field input[type="password"] {
	width: 100%;
	padding: 12px 14px;
	font: 700 15px/1.4 var(--cos-font-body);
	color: #23281F;
	background: #FBFAF2;
	border: 0;
	border-radius: 7px;
	box-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}
.cos-field input:hover { background: #FFFFFF; }
.cos-field input:focus { background: #FFFFFF; box-shadow: 0 0 0 3px var(--cos-gold); }

.cos-remember {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 13.5px;
	color: var(--cos-chalk-dim);
	font-weight: 600;
}

.cos-login-help { margin: 0; text-align: center; font-size: 13px; }
.cos-login-help a { color: var(--cos-gold); font-weight: 700; text-decoration: none; }
.cos-login-help a:hover { text-decoration: underline; }

.cos-login-foot {
	margin: 2px 0 0;
	padding-top: 15px;
	border-top: 1px solid var(--cos-rule);
	text-align: center;
	font-size: 12.5px;
	color: var(--cos-chalk-faint);
	line-height: 1.5;
}

/* --- Sélecteur d'implantation -------------------------------------------- */

.cos-picker { display: flex; flex-direction: column; gap: 10px; }
.cos-sites { display: flex; gap: 10px; flex-wrap: wrap; }

.cos-site {
	background: var(--cos-slate-soft);
	border: 2px solid var(--cos-rule);
	border-radius: var(--cos-radius);
	padding: 12px 16px;
	text-decoration: none;
	color: var(--cos-chalk);
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 215px;
	transition: border-color .15s, background .15s;
}
.cos-site:hover { border-color: var(--cos-chalk-faint); background: var(--cos-slate-lift); }
.cos-site-name { font-weight: 800; font-size: 14.5px; }
.cos-site-meta { font-size: 12.5px; color: var(--cos-chalk-dim); }
.cos-site[aria-current="page"] {
	border-color: var(--cos-gold);
	background: var(--cos-slate-lift);
}
.cos-site[aria-current="page"] .cos-site-name { color: var(--cos-gold); }

/* --- Bandeau de semaine --------------------------------------------------- */

.cos-weekbar {
	background: var(--cos-slate-deep);
	border: 1px solid var(--cos-rule);
	border-left: 5px solid var(--cos-gold);
	border-radius: var(--cos-radius);
	padding: 16px 20px;
	display: flex;
	gap: 18px;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
}

.cos-week { display: flex; flex-direction: column; gap: 2px; }
.cos-iso {
	font-family: var(--cos-font-mono);
	font-size: 11.5px;
	color: var(--cos-chalk-faint);
	letter-spacing: .06em;
}
.cos-range {
	font-family: var(--cos-font-chalk);
	font-size: 25px;
	font-weight: 700;
	color: #FFFFFF;
	line-height: 1.15;
}

.cos-nav { display: flex; gap: 6px; }
.cos-navbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px; height: 36px;
	border: 2px solid var(--cos-rule);
	border-radius: var(--cos-pill);
	color: var(--cos-chalk-dim);
	text-decoration: none;
	font-size: 17px;
	transition: border-color .15s, color .15s;
}
.cos-navbtn:hover { border-color: var(--cos-gold); color: var(--cos-gold); }

.cos-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.cos-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border-radius: var(--cos-pill);
	padding: 7px 15px 7px 12px;
	font-size: 12.5px;
	font-weight: 800;
	letter-spacing: .02em;
	border: 2px solid transparent;
}
.cos-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cos-pill--open   { color: var(--cos-green); background: rgba(110, 208, 155, .13); border-color: rgba(110, 208, 155, .45); }
.cos-pill--adjust { color: var(--cos-gold);  background: rgba(241, 181, 1, .13);   border-color: rgba(241, 181, 1, .45); }
.cos-pill--lock   { color: var(--cos-red);   background: rgba(232, 119, 106, .13);  border-color: rgba(232, 119, 106, .45); }

.cos-deadline { font-size: 13px; color: var(--cos-chalk-dim); }
.cos-deadline b { color: var(--cos-gold); font-weight: 800; font-variant-numeric: tabular-nums; }

/* --- Messages -------------------------------------------------------------- */

.cos-notice {
	border-radius: var(--cos-radius);
	padding: 14px 18px;
	font-size: 13.5px;
	line-height: 1.5;
	border: 1px solid;
	border-left-width: 5px;
	background: var(--cos-slate-deep);
}
.cos-notice strong { font-weight: 800; }
.cos-notice--ok    { border-color: rgba(110, 208, 155, .4); border-left-color: var(--cos-green); color: var(--cos-green); }
.cos-notice--warn  { border-color: rgba(241, 181, 1, .4);   border-left-color: var(--cos-gold);  color: var(--cos-gold); }
.cos-notice--error { border-color: rgba(232, 119, 106, .4); border-left-color: var(--cos-red);   color: var(--cos-red); }
.cos-notice--info  { border-color: var(--cos-rule);         border-left-color: var(--cos-chalk-faint); color: var(--cos-chalk-dim); }

/* --- La grille, dans son cadre de bois ------------------------------------- */

.cos-form { display: flex; flex-direction: column; gap: 18px; margin: 0; }

.cos-sheet {
	background: var(--cos-slate-deep);
	border: 9px solid var(--cos-wood);
	border-radius: 8px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), 0 18px 40px -34px rgba(0, 0, 0, .9);
	overflow: hidden;
}

.cos-sheet-head {
	padding: 18px 22px 14px;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 14px;
	flex-wrap: wrap;
}
.cos-sheet-head h2 { font-family: var(--cos-font-chalk); font-size: 27px; font-weight: 700; color: #FFFFFF; }
.cos-sheet-head p { margin: 3px 0 0; font-size: 13px; color: var(--cos-chalk-dim); }

.cos-scroller { overflow-x: auto; padding: 0 22px 20px; }

.cos-table { width: 100%; border-collapse: collapse; min-width: 780px; }

.cos-table thead th {
	text-align: center;
	vertical-align: top;
	padding: 8px 12px 14px;
	border-bottom: 2px solid var(--cos-rule);
}
.cos-table thead th:first-child {
	width: 235px;
	text-align: left;
	font-size: 12.5px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--cos-chalk-faint);
}

.cos-daykey {
	font-family: var(--cos-font-display);
	font-size: 17px;
	font-weight: 600;
	display: block;
	color: #FFFFFF;
	letter-spacing: .01em;
}
.cos-date { color: var(--cos-chalk-dim); font-size: 12.5px; font-weight: 600; }

/* Le menu du jour, écrit à la craie. */
.cos-menu {
	display: block;
	margin-top: 8px;
	text-align: left;
	font-family: var(--cos-font-chalk);
	font-weight: 600;
	font-size: 16.5px;
	line-height: 1.32;
	color: #EAF2E6;
	max-width: 210px;
}
.cos-menu span { display: block; }
.cos-menu span + span { color: #CBDDC7; font-size: 15.5px; }
.cos-menu i { display: none; }
.cos-menu--empty {
	font-family: var(--cos-font-body);
	font-size: 12.5px;
	font-weight: 600;
	color: var(--cos-chalk-faint);
	font-style: italic;
}

.cos-table tbody th {
	text-align: left;
	font-weight: 800;
	font-size: 14px;
	padding: 14px 12px;
	border-bottom: 1px solid var(--cos-rule);
	vertical-align: middle;
	color: var(--cos-chalk);
}
.cos-type { display: block; }
.cos-age  { display: block; font-size: 11.5px; font-weight: 600; color: var(--cos-chalk-faint); margin-top: 1px; }

.cos-table tbody td {
	padding: 9px 10px;
	border-bottom: 1px solid var(--cos-rule);
	text-align: center;
}

/* Les seules surfaces claires de l'écran : c'est là qu'on écrit. */
.cos-table input[type="number"] {
	width: 66px;
	padding: 10px 4px;
	text-align: center;
	font: 800 16px/1 var(--cos-font-body);
	font-variant-numeric: tabular-nums;
	color: #23281F;
	background: #FBFAF2;
	border: 0;
	border-radius: 6px;
	box-shadow: 0 2px 0 rgba(0, 0, 0, .3);
	-moz-appearance: textfield;
	transition: box-shadow .12s, background .12s;
}
.cos-table input[type="number"]::-webkit-outer-spin-button,
.cos-table input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cos-table input[type="number"]:hover:not(:disabled) { background: #FFFFFF; }
.cos-table input[type="number"]:focus { background: #FFFFFF; box-shadow: 0 0 0 3px var(--cos-gold); }
.cos-table input[type="number"]:disabled {
	background: transparent;
	color: var(--cos-chalk-faint);
	box-shadow: inset 0 0 0 2px var(--cos-rule);
	cursor: not-allowed;
	font-weight: 600;
}

.cos-frozen { background: rgba(0, 0, 0, .14); }
.cos-frozen-tag {
	display: block;
	font-size: 9.5px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--cos-chalk-faint);
	margin-top: 5px;
}

.cos-rowtotal { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--cos-chalk-dim); }

.cos-table tfoot th,
.cos-table tfoot td {
	padding: 16px 12px 4px;
	font-weight: 800;
	text-align: center;
	font-size: 16px;
	font-variant-numeric: tabular-nums;
	color: var(--cos-gold);
}
.cos-table tfoot th {
	text-align: left;
	font-family: var(--cos-font-display);
	font-weight: 600;
	font-size: 16px;
	color: var(--cos-chalk);
}
.cos-grand {
	font-family: var(--cos-font-display) !important;
	font-size: 22px !important;
	color: var(--cos-gold) !important;
}

/* --- Actions ---------------------------------------------------------------- */

.cos-actions { display: flex; gap: 12px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

.cos-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font: 800 13px/1 var(--cos-font-body);
	letter-spacing: .05em;
	text-transform: uppercase;
	padding: 14px 26px;
	border-radius: 8px;
	border: 2px solid var(--cos-rule);
	background: transparent;
	color: var(--cos-chalk);
	cursor: pointer;
	transition: border-color .15s, background .15s, color .15s;
}
.cos-btn:hover { border-color: var(--cos-chalk-dim); background: rgba(255, 255, 255, .05); }

.cos-btn--primary {
	background: var(--cos-gold);
	border-color: var(--cos-gold);
	color: #2A2110;
}
.cos-btn--primary:hover { background: var(--cos-gold-deep); border-color: var(--cos-gold-deep); color: #2A2110; }

.cos-btn--block { width: 100%; }

/* --- Historique ------------------------------------------------------------- */

.cos-history { display: flex; flex-direction: column; gap: 12px; }

.cos-rows {
	background: var(--cos-slate-deep);
	border: 1px solid var(--cos-rule);
	border-radius: var(--cos-radius);
	overflow: hidden;
}

.cos-row {
	display: grid;
	grid-template-columns: 110px 1fr auto auto auto;
	gap: 18px;
	align-items: center;
	padding: 14px 20px;
	border-bottom: 1px solid var(--cos-rule);
	font-size: 13.5px;
}
.cos-row:last-child { border-bottom: 0; }
.cos-row:hover { background: var(--cos-slate-soft); }
.cos-total { font-variant-numeric: tabular-nums; color: var(--cos-chalk-dim); font-weight: 700; }
.cos-row a { color: var(--cos-gold); text-decoration: none; font-weight: 800; }
.cos-row a:hover { text-decoration: underline; }

.cos-tag {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: var(--cos-pill);
	background: rgba(255, 255, 255, .07);
	color: var(--cos-chalk-dim);
}
.cos-tag--validated { color: var(--cos-green); background: rgba(110, 208, 155, .14); }
.cos-tag--adjusted  { color: var(--cos-gold);  background: rgba(241, 181, 1, .14); }
.cos-tag--corrected { color: var(--cos-gold);  background: rgba(241, 181, 1, .14); }

/* --- Pied -------------------------------------------------------------------- */

.cos-footer {
	max-width: 1180px;
	margin: 0 auto;
	padding: 22px;
	display: flex;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
	font-size: 12.5px;
	color: var(--cos-chalk-faint);
	border-top: 1px solid var(--cos-rule);
}
.cos-footer a { color: var(--cos-chalk-dim); }
.cos-footer a:hover { color: var(--cos-gold); }

@media (max-width: 640px) {
	.cos-row { grid-template-columns: 1fr auto; row-gap: 8px; }
	.cos-table thead th:first-child { width: 165px; }
	.cos-scroller { padding: 0 12px 16px; }
	.cos-sheet { border-width: 6px; }
	.cos-actions { justify-content: stretch; }
	.cos-actions .cos-btn { flex: 1; }
	.cos-login-card { padding: 26px 20px 22px; border-width: 7px; }
}

/* --- Impression ---------------------------------------------------------------
   Une ardoise imprimée, c'est une cartouche vidée. Le bon de commande sort en
   noir sur blanc, sans les commandes ni la navigation.
   ---------------------------------------------------------------------------- */

@media print {
	.cos-body {
		background: #FFFFFF !important;
		background-image: none !important;
		color: #000000;
	}

	.cos-topbar, .cos-footer { border-color: #000000; background: transparent; }
	.cos-nav, .cos-actions, .cos-picker, .cos-account { display: none; }

	.cos-main h1, .cos-range, .cos-sheet-head h2 { color: #000000; }

	.cos-sheet {
		border: 1px solid #000000;
		box-shadow: none;
		background: transparent;
	}

	.cos-weekbar, .cos-rows, .cos-card { background: transparent; border-color: #999999; }

	.cos-table thead th, .cos-table tbody th, .cos-table tbody td,
	.cos-daykey, .cos-menu, .cos-menu span + span, .cos-type, .cos-rowtotal {
		color: #000000;
		border-color: #999999;
	}

	.cos-table tfoot th, .cos-table tfoot td, .cos-grand { color: #000000 !important; }

	.cos-table input[type="number"] {
		background: transparent;
		color: #000000;
		box-shadow: inset 0 0 0 1px #999999;
	}
}
