
/* ===== production/map/static/css/zone.css ===== */
#zone-header {
	background-color: var(--background-body);
	position: sticky;
	z-index: 50;
	top: 0;
}

@media (min-width: 1100px) and (min-height: 600px) {

	main #zone-header {
		height: 6rem;
	}

}

@media (max-width: 1099px), (max-height: 599px) {

	body[data-touch="no"] main #zone-content #zone-header {
		top: calc(var(--nav-height) + 2.25rem);
	}

}

.panel #zone-header {
	background-color: white;
}

.zone-button {
	text-align: left;
	width: calc(100% - 1rem);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.zone-dropdown {
	display: inline-block;
	max-width: 9rem;
	overflow: hidden;
	vertical-align: middle;
	text-align: left;
	line-height: 1.2;
}

@media (min-width: 1200px) {

	.zone-dropdown {
		max-width: 12rem;
	}

}

body.bed-updating .bed-read,
body.panel-open .bed-read {
	display: none;
}

body:not(.bed-updating):not(.panel-open) .bed-write {
	display: none;
}

.zone-corner {
	position: sticky;
	top: 0;
	background-color: var(--background-body);
	align-self: stretch;
	z-index: 1;
	display: flex;
	align-items: end;
	padding: 1rem 0 0 0 !important;
	margin-bottom: 0.5rem;
}

.panel .zone-corner {
	background-color: white;
	left: 0;
}

.soil-views {
	position: sticky;
	top: var(--mainSticky);
	z-index: 450;
	background-color: var(--background-body);
}

.panel .soil-views {
	top: var(--soil-views-top, 0px);
	background-color: white;
}

.panel .zone-wrapper {
	scroll-margin-top: calc(var(--soil-views-top, 0px) + var(--soil-views-height, 0px));
}

.soil-views-aside {
	padding-right: 0;
}

.tabs.soil-views div.tabs-item-wrapper {
	grid-template-columns: max-content minmax(0, 1fr);
	grid-row-gap: 0;
	align-items: center;
	margin-bottom: 1.5rem;
}

.tabs.soil-views div.tabs-item {
	margin-bottom: 0;
}

.soil-views-aside .zone-corner {
	position: static;
	align-self: auto;
	justify-content: flex-end;
	padding: 0 !important;
	margin-bottom: 0;
	background-color: transparent;
}

.soil-views-aside .zone-button {
	flex: none;
	width: max-content;
	max-width: 100%;
}

.soil-views-aside .zone-dropdown {
	flex: 0 1 auto;
	min-width: 0;
	max-width: none;
	overflow: hidden;
	text-overflow: ellipsis;
}

body[data-touch="no"] main .zone-corner {
	left: calc(var(--nav-width) + var(--container-padding));
}

body[data-touch="yes"] main .zone-corner {
	left: 0;
}

div.zone-header-season {
	overflow: hidden;
}

.zone-count,
.plot-count {
	margin-left: .5rem;
}

.plot-count:empty,
.zone-count:empty {
	display: none;
}

#zone-selector [data-plot] {
	padding-top: 0.375rem;
	padding-bottom: 0.375rem;
}

/* Cartographie */
div.zone-map {
	width: 100%;
	height: 100%;
}

#zone-map-write {
	width: 100%;
	height: 500px;
}

/* Items */
@media screen {

	body[data-touch="yes"] main #zone-content {
		width: calc(var(--screen-width) - var(--container-padding) * 2 - var(--nav-width));
		overflow-x: auto;
	}

	main #zone-content > *:not(:has(.plot-card-scroll)) {
		min-width: calc(var(--zone-content-months) * 4.5rem + 10rem);
	}

	#zone-content [data-hide="1"]:not(.selected) {
		display: none;
	}

}

div.zone-wrapper {
	position: relative;
}

div.zone-printing div.zone-wrapper {
	margin-bottom: 2rem;
	display: grid;
	grid-template-columns: 4.5cm 1fr;
}

@media screen {

	div.zone-title {
		z-index: 45;
	}

}

div.zone-printing div.zone-title {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	padding: 0 0 0.5rem 0;
	width: auto;
}

div.zone-printing div.zone-title h2 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
}

div.zone-printing .plot-card,
div.zone-printing .util-card {
	box-shadow: none;
}

@media screen {

	div.zone-title {
		padding: 1.25rem 0.75rem;
		background: var(--secondary);
		border-top-left-radius: var(--radius);
		border-top-right-radius: var(--radius);
		color: white;
	}

	#zone-header + .zone-wrapper div.zone-title {
		border-top-left-radius: var(--radius);
		border-top-right-radius: var(--radius);
	}

}

@media print {

	div.zone-title h2 {
		font-size: 2rem;
		font-weight: bold;
	}

}

div.zone-title a {
	color: white;
}

body.bed-updating div.zone-title,
body.panel-open div.zone-title {
	padding-left: 0;
}

.zone-title-area {
	margin-left: 1rem;
}

@media screen {

	.zone-title-area {
		font-size: 1rem;
		opacity: 0.8;
	}

	main .zone-sticky-left {
		position: sticky;
		width: calc(var(--screen-width) - var(--nav-width) - var(--container-padding) * 2);
	}

	@media (min-width: 1100px) and (min-height: 600px) {

		main div.zone-title {
			top: 6rem;
		}

	}

	body[data-touch="no"] {

		main .zone-sticky-overlay-left,
		main .zone-sticky-overlay-right {
			display: block;
			width: var(--container-padding);
			background-color: var(--background-body);
			top: 0;
			height: 100vh;
			position: fixed;
			z-index: 98;
		}

		.zone-sticky-overlay-left {
			left: var(--nav-width);
		}

		.zone-sticky-overlay-right {
			right: 0;
		}

		main .zone-sticky-left {
			left: calc(var(--nav-width) + var(--container-padding));
		}

	}

	body[data-touch="yes"] {

		main .zone-sticky-left {
			left: 0;
		}

	}

}

@media print {

	.zone-title-area {
		font-size: 1.5rem;
	}

}

div.zone-printing .zone-table {
	margin: 0 !important;
}

div.zone-printing .zone-table tbody {
	position: relative;
	z-index: 0;
}

div.zone-printing .zone-table td {
	padding: 0 !important;
}

div.zone-printing .zone-table thead {
	position: relative;
	z-index: 1;
}

div.zone-printing .zone-table th {
	padding: 0 0 0 16rem !important;
}

div.zone-printing .zone-plots .series-season {
	display: none;
}

#zone-content .zone-title {
	position: static;
}

#zone-content #zone-header {
	top: 2.25rem;
}

body[data-touch="no"] main #zone-content #zone-header {
	top: 2.25rem;
}

.place-zone-bar {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	background-color: var(--production);
	color: white;
	border-radius: var(--radius);
	padding: 0.5rem 0.875rem;
	margin: 0.875rem 0 0.625rem;
}

.place-zone-bar b {
	font-size: 1rem;
}

.zone-wrapper > .place-zone-bar {
	position: sticky;
	top: var(--soil-views-height, 4.625rem);
	z-index: 430;
}


.place-zone-bar-info {
	opacity: 0.8;
	font-size: 0.75rem;
}

.place-zone-bar-outside {
	margin-left: auto;
}

.place-zone-bar-rule {
	margin-left: auto;
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.8125rem;
	font-weight: 400;
}

.garden-plots {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: flex-start;
}

/* ===== production/map/static/css/plot.css ===== */
/* Items */
div.plot-title {
	padding: 1rem 0.75rem;
	background-color: #8883;
}

.plot-wrapper-folded.plot-card > div.plot-title {
	display: none;
}

@media print {

	div.plot-title {
		padding: .5rem 0.75rem;
	}

}

body.bed-updating div.plot-title,
body.panel-open div.plot-title {
	padding-left: 0;
}

div.plot-title h4 {
	font-weight: bold;
}

.plot-title-area {
	opacity: 0.8;
	font-size: 1rem;
	margin-left: 1rem;
	font-weight: normal;
}

/* Maps */

p.plot-map-help {
	font-size: 0.9rem;
	color: var(--secondary);
}

div.plot-map {
	width: 100%;
	height: 300px;
}

#plot-map-write {
	width: 100%;
	height: 500px;
}

#plot-map-polygon {
	background-color: var(--background-light);
	padding: 1rem;
	text-align: center;
	display: none;
	justify-content: space-between;
	align-items: center;
}

/* Use */
form.plot-use {
	padding: 1rem;
	background-color: #eee;
}

div.plot-use-options {
	margin: 1rem 0 0.5rem;
}

.plot-card {
	position: relative;
	padding: 0.75rem;
	margin-bottom: 0.75rem;
}

.plot-card div.plot-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0 0 0.5rem 0;
	background: none;
	font-weight: 700;
}

.plot-title-info {
	color: var(--muted);
	font-size: 0.8125rem;
	font-weight: 400;
}

.plot-card .plot-card-axis {
	border: 0;
}

.plot-card .plot-card-axis > div:first-child {
	position: sticky;
	left: 0;
	z-index: 10;
	align-self: stretch;
	background-color: white;
}

.plot-card .plot-card-months .series-timeline-season {
	margin: 0;
}

.plot-card div.bed-item-grid-plan:not(.bed-item-grid-header):nth-child(even),
.plot-card div.bed-item-grid-plan:not(.bed-item-grid-header):nth-child(odd) {
	background-color: transparent;
}

/* Le nom reste colle a gauche quand la carte defile : transparent, il laissait voir les series passer dessous. */
.plot-card div.bed-item-grid-plan:not(.bed-item-grid-header):nth-child(even) .bed-item-bed,
.plot-card div.bed-item-grid-plan:not(.bed-item-grid-header):nth-child(odd) .bed-item-bed {
	background-color: white;
}

.plot-card div.bed-item-grid-plan.bed-item-fill,
.plot-card div.bed-item-grid-plan.bed-item-fill .bed-item-bed {
	background-color: var(--background-odd);
}

.plot-card div.bed-item-grid-plan:not(.bed-item-grid-header) {
	min-height: 2.625rem;
}

.plot-card-body {
	position: relative;
}


.plot-card-scroll {
	position: relative;
	overflow-x: auto;
	overflow-y: hidden;
	contain: inline-size;
}

.plot-card-axis,
.plot-card-body > .bed-item-grid,
.plot-card-body > [class*="bed-item-grid-rotation"] {
	min-width: calc(var(--zone-content-months) * 2.5rem + 12rem);
}

.plot-card-scroll > .series-grid {
	min-width: calc(var(--zone-content-months) * 2.5rem);
}

.plot-card-rotation {
	flex: 1 1 100%;
	min-width: 0;
}

.plot-card-rotation .plot-card-axis,
.plot-card-rotation .plot-card-body > .bed-item-grid,
.plot-card-rotation .plot-card-body > [class*="bed-item-grid-rotation"] {
	min-width: 30rem;
}

/* ===== production/map/static/css/bed.css ===== */
/* Liste de planches avec leurs cultures */
div.bed-item-wrapper {
	position: relative;
}

div.bed-item-grid {
	display: grid;
	align-items: baseline;
	background-color: white;
	break-inside: avoid;
}

div.bed-item-grid.selected,
div.bed-item-grid.selected .bed-item-bed {
	background-color: var(--info) !important;
}

div.bed-item-fill {
	display: none;
}

@media print {

	div.plot-wrapper.plot-wrapper-preserve {
		break-inside: avoid;
	}

}

div.zone-wrapper:has(input.zone-title-fill:checked) .bed-item-fill-zone,
div.plot-wrapper:has(input.plot-title-fill:checked) .bed-item-fill-plot {
	display: grid;
	padding: 0.5rem 0;
}

body:not(.bed-updating):not(.panel-open) div.zone-wrapper:has(.place-grid-series-timeline) .bed-item-fill-zone,
body:not(.bed-updating):not(.panel-open) div.plot-wrapper:has(.place-grid-series-timeline) .bed-item-fill-plot {
	display: grid;
}

body.bed-updating div.zone-wrapper .bed-item-fill-zone,
body.bed-updating div.plot-wrapper .bed-item-fill-plot,
body.panel-open div.zone-wrapper .bed-item-fill-zone,
body.panel-open div.plot-wrapper .bed-item-fill-plot {
	display: grid;
	padding: 0.5rem 0;
}

div.bed-item-grid-plan:not(.bed-item-grid-header):nth-child(even),
div.bed-item-grid-plan:not(.bed-item-grid-header):nth-child(even) .bed-item-bed {
	background-color: white;
}

div.bed-item-grid-plan:not(.bed-item-grid-header):nth-child(odd),
div.bed-item-grid-plan:not(.bed-item-grid-header):nth-child(odd) .bed-item-bed {
	background-color: var(--background-odd);
}

div.bed-item-grid-plan:not(.bed-item-grid-header):hover,
div.bed-item-grid-plan:not(.bed-item-grid-header):hover .bed-item-bed,
div.bed-item-grid-rotation:not(.bed-item-grid-header):hover {
	background-color: var(--background);
	transition: background-color 0.25s;
}

div.bed-item-grid-plan:not(.bed-item-grid-header),
div.bed-item-grid-rotation:not(.bed-item-grid-header) {
	border-bottom: 1px solid var(--border);
}

div.bed-item-grid-plan {
	grid-template-columns: 12rem 1fr;
	align-items: center;
}

@media print {

	div.bed-item-grid-plan {
		grid-template-columns: 16rem 1fr !important;
	}

}

div.bed-item-grid-plan.bed-item-grid-header {
	align-items: end;
}

div.zone-update div.bed-item-grid-plan {
	grid-template-columns: 16rem 1fr;
}

div.series-grid {
	left: 12rem;
}

div.zone-update div.zone-wrapper div.series-grid {
	left: 16rem;
}

@media print {

	div.series-grid {
		left: 16rem !important;
	}

}

div.bed-item-grid-rotation-5 {
	grid-template-columns: 1fr repeat(5, 1fr);
}

div.bed-item-grid-rotation-4 {
	grid-template-columns: 1fr repeat(4, 1fr);
}

div.bed-item-grid-rotation-3 {
	grid-template-columns: 1fr repeat(3, 1fr);
}

div.bed-item-grid-rotation-2 {
	grid-template-columns: 1fr repeat(2, 1fr);
}

@media (max-width: 1199px) {

	div.bed-item-grid-plan {
		grid-template-columns: 9rem 1fr;
	}

	div.zone-update div.bed-item-grid-plan {
		grid-template-columns: 12rem 1fr;
	}

	div.zone-wrapper div.series-grid {
		left: 9rem;
	}

	div.zone-update div.zone-wrapper div.series-grid {
		left: 12rem;
	}

}

@media (max-width: 768px) {

	div.bed-item-grid-rotation-5 {
		grid-template-columns: 8rem repeat(5, 1fr);
	}

	div.bed-item-grid-rotation-4 {
		grid-template-columns: 8rem repeat(4, 1fr);
	}

	div.bed-item-grid-rotation-3 {
		grid-template-columns: 8rem repeat(3, 1fr);
	}

	div.bed-item-grid-rotation-2 {
		grid-template-columns: 8rem repeat(2, 1fr);
	}

	div.zone-update div.bed-item-grid-plan {
		grid-template-columns: 10rem 1fr;
	}

	div.zone-update div.zone-wrapper div.series-grid {
		left: 10rem;
	}

}

div.bed-item-grid .bed-item-bed {
	align-self: stretch;
	z-index: 10;
	display: flex;
	align-items: center;
}

@media screen {

	div.bed-item-grid .bed-item-bed {
		position: sticky;
	}

	body[data-touch="no"] main div.bed-item-grid .bed-item-bed {
		left: calc(var(--nav-width) + var(--container-padding));
	}

	body[data-touch="yes"] main div.bed-item-grid .bed-item-bed {
		left: 0;
	}

	.panel div.bed-item-grid .bed-item-bed {
		left: 0;
	}

	body main div.plot-card div.bed-item-grid .bed-item-bed {
		left: 0;
	}

}

.bed-item-select {
	align-self: stretch;
	color: white;
	margin: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	width: 3rem;
	min-width: 3rem;
}

@media (max-width: 991px) {

	.bed-item-select {
		width: 2.5rem;
		min-width: 2.5rem;
	}

}

div.bed-item-grid .bed-item-select {
	background-color: #0001;
}

div.zone-title .bed-item-select,
div.plot-title .bed-item-select {
	margin-right: 0.75rem;
}


div.bed-item-grid:has(input[name^="beds"]:checked) .bed-item-select {
	background-color: var(--info);
}

div.bed-item-grid .bed-item-content {
	line-height: 1.2;
	display: flex;
	width: 100%;
}

@media screen {

	div.bed-item-grid .bed-item-content {
		flex-direction: column;
		justify-content: center;
		padding-left: 0.75rem;
		padding-top: 0.25rem;
		padding-bottom: 0.25rem;
	}

}

@media print {

	div.bed-item-grid .bed-item-content {
		align-items: center;
		justify-content: space-between;
		padding: 0.25rem 0.75rem;
	}

}

body.bed-updating div.bed-item-grid:has(input[name^="beds"]:checked) .bed-item-content {
	min-height: 5rem;
}

div.bed-item-grid div.bed-item-name {
	letter-spacing: -0.1px;
	display: flex;
	justify-content: space-between;
}

div.bed-item-grid div.bed-item-name a {
	color: black;
}

div.bed-item-grid div.bed-item-size {
	font-size: 0.7rem;
	color: #999;
}

div.bed-item-grid div.bed-item-size-read {
	margin-top: 0.125rem;
}

div.bed-item-grid div.bed-item-size-write,
div.bed-item-grid div.bed-item-size-fill {
	width: 12rem;
	margin-top: 0.25rem;
}


div.bed-item-grid div.bed-item-size-write input,
div.bed-item-grid div.bed-item-size-fill input {
	text-align: center;
}

div.bed-item-grid div.bed-item-size-write .input-group-addon,
div.bed-item-grid div.bed-item-size-fill .input-group-addon {
	background-color: var(--background) !important;
	font-size: 0.8rem !important;
}

div.bed-item-grid:has(input[name^="beds"]:checked) div.bed-item-size-read {
	display: none;
}

div.bed-item-grid:not(:has(input[name^="beds"]:checked)) div.bed-item-size-write {
	display: none;
}

div.bed-item-grid .bed-item-rotation {
	font-size: 0.9rem;
	color: var(--secondary);
	white-space: nowrap;
	padding-right: 0.5rem;
}

@media (max-width: 991px) {

	div.bed-item-grid .bed-item-rotation {
		display: none;
	}

}

/* Pas de clip-path : il rogne l'affichage mais laisse le débordement dans la zone de défilement */
div.bed-item-grid div.bed-item-places {
	overflow-x: clip;
}

div.bed-item-grid div.bed-item-cultivation {
	padding: 0.5rem;
	height: 100%;
}

div.bed-item-grid-rotation div.bed-item-cultivation {
	height: calc(100% - 1px);
	margin-bottom: 1px;
}

div.bed-item-grid div.series-timeline-season:not(:empty) {
	overflow: hidden;
}

div.bed-item-grid div.bed-item-cultivation-muted {
	opacity: 0.5;
}

div.bed-item-grid div.bed-item-followup,
div.bed-item-grid div.bed-item-followup + div,
div.bed-item-grid div.bed-item-followup + div + div {
	border-top: 1px solid var(--border);
}

div.bed-item-grid div.bed-item-cultivation-family {
	display: flex;
	flex-wrap: wrap;
}

div.bed-item-grid div.bed-item-cultivation-family > * {
	margin-right: -0.33rem;
	margin-bottom: 0.25rem;
}

div.bed-item-grid div.bed-item-cultivation-family > .bed-item-cultivation-gap {
	margin-right: 0;
	margin-left: 0.75rem;
}

div.bed-item-grid div.bed-item-cultivation-plant {
	font-size: 0.9rem;
	line-height: 1;
}

/* Grid */
/* Create */
#bed-create-form {
}

#bed-create-form[data-number="0"] {
	display: none;
}

#bed-create-names {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	grid-gap: 1rem;
}


.bed-create-one h5 {
	margin-bottom: 0.25rem;
}

.bed-create-fill {
	display: grid;
	grid-template-columns: 1fr;
	grid-gap: 0.5rem;
}

@media (max-width: 991px) {

	.bed-create-fill {
		grid-template-columns: auto;
	}

}

/* Write */

div.bed-write-size-form {
	display: grid;
	grid-template-columns: 4fr 3fr;
	align-items: center;
	grid-column-gap: 0.5rem;
	margin-top: 0.5rem;
}

@media (max-width: 575px) {

	div.bed-write-size-form {
		grid-template-columns: 1fr;
		grid-row-gap: 0.5rem;
	}

}

div.bed-write-size-area {
	font-weight: bold;
	margin-top: 0.5rem;
	text-align: right;
}

div.bed-write-size-area[data-area="0"] {
	display: none;
}

#bed-map-line {
	width: 100%;
	height: 500px;
	max-height: 70vh;
}
div.plot-card div[class*="bed-item-grid-rotation"]:not(.bed-item-grid-header) {
	min-height: 2.75rem;
	align-items: center;
}

div.plot-card div.bed-item-cultivation {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
	height: calc(100% - 0.375rem);
	margin: 0.1875rem 0.25rem;
	padding: 0.25rem 0.5rem;
	border-radius: 6px;
	overflow: hidden;
}

.plot-card div.bed-item-cultivation-family {
	flex: none;
	align-items: center;
	gap: 0.125rem;
	flex-wrap: nowrap;
}

div.plot-card div.bed-item-cultivation-family > * {
	margin: 0;
}

.plot-card div.bed-item-cultivation-plant {
	min-width: 0;
	color: var(--muted);
	font-size: 0.8125rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.plot-card div.bed-item-cultivation-plant a {
	color: inherit;
}

.bed-item-cultivation-empty {
	color: var(--muted);
}

.bed-item-cultivation-gap {
	margin-left: 0.25rem;
	font-size: 0.6875rem;
	font-weight: 700;
	white-space: nowrap;
}

.bed-item-cultivation-return-close {
	box-shadow: inset 0 0 0 2px var(--danger);
}

.bed-item-cultivation-return-close .bed-item-cultivation-gap {
	color: var(--danger);
}

.bed-item-cultivation-return-near {
	box-shadow: inset 0 0 0 2px var(--warning);
}

.bed-item-cultivation-return-near .bed-item-cultivation-gap {
	color: var(--warning);
}

.bed-item-cultivation-family-return {
	position: relative;
	z-index: 1;
}

.bed-item-cultivation-family-return .family-vignette-letter {
	box-shadow: 0 0 0 2px white, 0 0 0 4px var(--warning);
}

.bed-item-cultivation-return-close .bed-item-cultivation-family-return .family-vignette-letter {
	box-shadow: 0 0 0 2px white, 0 0 0 4px var(--danger);
}

.plot-title-watch {
	color: var(--danger);
	font-size: 0.8125rem;
	font-weight: 600;
}

.plot-card div.bed-item-rotation-fill,
.plot-card div.bed-item-rotation-fill .bed-item-bed {
	background-color: var(--background-odd);
}

/* ===== production/plant/static/css/family.css ===== */
/* Family vignette */
.family-vignette-letter {
	width: 2rem;
	height: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	color: white;
	background-color: black;
	font-weight: bold;
	text-decoration: none;
	font-variant: small-caps;
	border-radius: 50%;
}
.plot-card .family-vignette-letter {
	width: 1.5rem;
	height: 1.5rem;
	font-size: 0.6875rem;
}

.family-vignette-letter-empty {
	background-color: var(--background-odd);
	color: var(--muted);
}

.family-vignette-more {
	background-color: var(--background-odd);
	color: var(--muted);
	font-size: 0.6875rem;
}
