@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=Source+Serif+4:wght@600;700&display=swap");

/* Dispo — calendar UI
   Direction: cool slate + forest accent (ops / logistics), not purple/cream AI defaults */

:root {
	--bg0: #e8eef2;
	--bg1: #f4f7f9;
	--ink: #1a242c;
	--muted: #5a6b78;
	--line: #c5d0d8;
	--accent: #1f6b4a;
	--accent-ink: #ffffff;
	--warn: #9a5b00;
	--danger: #9b2c2c;
	--card: rgba(255, 255, 255, 0.82);
	--shadow: 0 12px 40px rgba(26, 36, 44, 0.08);
	--radius: 10px;
	--font-display: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
	--font-ui: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	min-height: 100%;
	font-family: var(--font-ui);
	color: var(--ink);
	background:
		radial-gradient(1200px 600px at 10% -10%, #d5e6df 0%, transparent 55%),
		radial-gradient(900px 500px at 100% 0%, #d2dde8 0%, transparent 50%),
		linear-gradient(180deg, var(--bg1), var(--bg0));
}

body.dispo-app {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	padding: 0 0 2rem;
}

a { color: var(--accent); }

.app-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.1rem 1.4rem;
	border-bottom: 1px solid var(--line);
	background: var(--card);
	backdrop-filter: blur(8px);
}

.brand {
	display: flex;
	gap: 0.75rem;
	align-items: center;
}

.brand-mark {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 8px;
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 600;
	letter-spacing: 0.04em;
}

.brand strong {
	display: block;
	font-family: var(--font-display);
	font-size: 1.35rem;
	line-height: 1.1;
}

.user-line {
	display: block;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
	text-align: left;
}

.user-line:hover {
	color: var(--ink);
}

.dispo-user {
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: inherit;
	cursor: pointer;
	text-decoration: none;
}

.dispo-user:hover,
.dispo-user:focus-visible {
	text-decoration: none;
	opacity: 0.75;
}

.dispo-vehicle {
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: inherit;
	cursor: pointer;
	text-decoration: none;
}

.dispo-vehicle:hover,
.dispo-vehicle:focus-visible {
	text-decoration: none;
	opacity: 0.75;
}

.dispo-ev-title .dispo-user,
.dispo-ev-body .dispo-user,
.dispo-ev-title .dispo-vehicle,
.dispo-ev-body .dispo-vehicle {
	color: inherit;
}

.dispo-ev.is-mine .dispo-user.is-me {
	color: #b03430;
}

.user-pop {
	position: fixed;
	z-index: 10000;
	min-width: 12rem;
	max-width: min(18rem, calc(100vw - 1rem));
	pointer-events: auto;
}

.user-pop-card {
	padding: 0.7rem 0.8rem;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: #fff;
	box-shadow: var(--shadow);
	display: grid;
	gap: 0.45rem;
}

.user-pop-name {
	font-size: 0.95rem;
	color: var(--ink);
}

.user-pop-row {
	display: grid;
	gap: 0.1rem;
	font-size: 0.82rem;
}

.user-pop-label {
	color: var(--muted);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.user-pop-link {
	color: var(--accent);
	word-break: break-all;
}

.user-pop-empty {
	color: var(--muted);
	font-style: italic;
}

.header-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.planner-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1rem;
	padding: 0.65rem 1.4rem;
	border-bottom: 1px solid var(--line);
	background: rgba(255, 255, 255, 0.55);
}

.planner-bar-actions,
.planner-bar-options {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.btn {
	appearance: none;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--ink);
	padding: 0.45rem 0.85rem;
	border-radius: 8px;
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.btn:hover { border-color: var(--muted); }
.btn.primary {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink);
}
.btn.warn {
	background: #b03430;
	border-color: #b03430;
	color: #fff;
}
.btn.warn:hover,
.btn.warn:focus-visible {
	background: #912926;
	border-color: #912926;
	color: #fff;
}
.btn.ghost { background: transparent; }
.btn.toggle.active {
	background: var(--ink);
	border-color: var(--ink);
	color: #fff;
}

.toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
	padding: 0.85rem 1.4rem;
}

.view-toggle, .filters, .type-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	align-items: center;
}

.type-filter-menu {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.type-filter-menu .type-filters {
	position: absolute;
	top: calc(100% + 0.35rem);
	right: 0;
	z-index: 40;
	min-width: 11rem;
	max-width: min(20rem, calc(100vw - 2rem));
	padding: 0.55rem;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #fff;
	box-shadow: var(--shadow);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.35rem;
}

.type-filter-menu .type-filters[hidden] {
	display: none !important;
}

.type-filter-menu.is-open #btn-type-filter {
	border-color: var(--ink);
	background: #f4f7f9;
}

.type-filter-menu .type-chip {
	width: 100%;
	justify-content: flex-start;
	border-radius: 8px;
}

.type-filter-all {
	appearance: none;
	width: 100%;
	margin: 0 0 0.15rem;
	padding: 0.35rem 0.55rem;
	border: 1px dashed var(--line);
	border-radius: 8px;
	background: #f7fafb;
	color: var(--muted);
	font: inherit;
	font-size: 0.8rem;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}

.type-filter-all:hover,
.type-filter-all:focus-visible {
	color: var(--ink);
	border-color: var(--muted);
	outline: none;
}

.check {
	display: inline-flex;
	gap: 0.4rem;
	align-items: center;
	font-size: 0.9rem;
	color: var(--muted);
}

.type-chip {
	border: 1px solid var(--line);
	background: #fff;
	border-radius: 999px;
	padding: 0.25rem 0.65rem;
	font-size: 0.8rem;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.type-chip input { accent-color: var(--accent); }
.type-chip .swatch {
	width: 0.65rem;
	height: 0.65rem;
	border-radius: 50%;
	display: inline-block;
}

.dispo-day-unassigned {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 0.2rem 0.25rem 0.3rem;
	margin: 0 0.15rem 0.15rem;
	box-sizing: border-box;
	border-radius: 5px;
	background: rgba(31, 107, 74, 0.06);
	border: 1px dashed rgba(31, 107, 74, 0.28);
}

.dispo-day-unassigned-head {
	padding: 0.1rem 0.3rem 0;
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--accent);
	letter-spacing: 0.01em;
}

.dispo-day-unassigned-row {
	display: block;
	padding: 0.15rem 0.3rem;
	font-size: 0.68rem;
	line-height: 1.35;
}

.dispo-day-unassigned-row .flag-label {
	display: inline;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--accent);
	white-space: nowrap;
}

.dispo-day-unassigned-row .flag-label::after {
	content: ' ·';
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	color: inherit;
	padding-right: 4px;
}

.dispo-day-unassigned-row .flag-names {
	display: inline;
	color: var(--ink);
	word-break: break-word;
}

.dispo-day-unassigned-row .flag-names .dispo-user,
.dispo-day-unassigned-row .flag-names .dispo-vehicle {
	display: inline;
}

.dispo-day-unassigned-row.is-none .flag-names {
	color: var(--muted);
	font-style: italic;
}

.dispo-day-flags {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 0.15rem 0.25rem 0.35rem;
	margin: 0 0.15rem;
	box-sizing: border-box;
	min-height: 3.25rem; /* keeps empty days aligned before JS equalizes */
}

.dispo-day-flags.is-empty {
	/* reserved space only — no visual chrome */
	visibility: hidden;
}

.dispo-day-flags-edit {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	margin-top: 0.2rem;
	padding: 0.15rem 0.35rem;
	border: 1px solid transparent;
	border-radius: 4px;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
}

.dispo-day-flags-edit:hover,
.dispo-day-flags-edit:focus-visible {
	color: var(--ink);
	border-color: var(--line);
	background: rgba(255, 255, 255, 0.7);
}

.dispo-day-add {
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: calc(100% - 0.3rem);
	margin: 0.35rem 0.15rem 0.25rem;
	padding: 0.2rem 0;
	border: 1px dashed var(--line);
	border-radius: 5px;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 1.1rem;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
}

.dispo-day-add:hover,
.dispo-day-add:focus-visible {
	border-color: var(--accent);
	color: var(--accent);
	background: rgba(31, 107, 74, 0.08);
}

.dispo-day-flag {
	display: block;
	padding: 0.2rem 0.35rem;
	border-radius: 4px;
	font-size: 0.68rem;
	line-height: 1.35;
}

.dispo-day-flag .flag-label {
	display: inline;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	opacity: 0.85;
	white-space: nowrap;
}

.dispo-day-flag .flag-label::after {
	content: ' ·';
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	opacity: 1;
	padding-right: 4px;
}

.dispo-day-flag .flag-names {
	display: inline;
	word-break: break-word;
}

.dispo-day-flag .flag-names .dispo-user,
.dispo-day-flag .flag-names .dispo-vehicle {
	display: inline;
}

.dispo-day-flag.flag-holiday {
	background: #f3e8e8;
	color: #7a3030;
}

.dispo-day-flag.flag-school {
	background: #e7eef6;
	color: #1e4d7b;
}

.dispo-day-flag.flag-spare {
	background: #eef6ea;
	color: #2a5a2a;
}

.dispo-day-flag.flag-sick {
	background: #fff0e0;
	color: #b35a00;
}

.dispo-day-flag.flag-comment {
	background: #f2f2f2;
	color: var(--muted);
	font-style: italic;
}

.fc .fc-daygrid-day-frame {
	min-height: 7rem;
}

#calendar {
	margin: 0 1rem;
	padding: 0.75rem;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	min-height: 70vh;
}

.fc {
	--fc-border-color: var(--line);
	--fc-page-bg-color: transparent;
	--fc-today-bg-color: rgba(90, 107, 120, 0.12);
	--fc-button-bg-color: var(--ink);
	--fc-button-border-color: var(--ink);
	--fc-button-hover-bg-color: #2c3a45;
	--fc-button-active-bg-color: var(--accent);
	--fc-button-active-border-color: var(--accent);
	font-family: var(--font-ui);
}

.fc .fc-toolbar-title {
	font-family: var(--font-display);
	font-size: 1.35rem;
}

/* Current day: light grey tint across body + column header */
.fc .fc-daygrid-day.fc-day-today,
.fc .fc-timegrid-col.fc-day-today,
.fc .fc-col-header-cell.fc-day-today {
	background: rgba(90, 107, 120, 0.12) !important;
}

.fc .fc-col-header-cell.fc-day-today a,
.fc .fc-col-header-cell.fc-day-today .fc-col-header-cell-cushion {
	color: var(--ink);
	font-weight: 600;
}

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
	color: var(--ink);
	font-weight: 700;
}

.fc-event {
	border: 2px solid var(--job-color, #2a6f4e) !important;
	border-radius: 5px;
	background: transparent !important;
	font-size: 0.72rem;
	padding: 0 !important;
	cursor: default;
	line-height: 1.25;
	height: auto !important;
	overflow: visible !important;
	color: var(--ink, #1a1a1a);
}

.fc-event .fc-event-main {
	padding: 0 !important;
	color: inherit;
}

.fc-daygrid-event {
	white-space: normal !important;
	position: relative !important;
	margin: 1px 2px 2px !important;
}

.fc-event.dispo-ev-mine {
	background: transparent !important;
	border-color: #b03430 !important;
}

.fc-event.dispo-ev-tbc {
	border-style: dashed !important;
}

.dispo-ev-tbc-label {
	font-weight: 700;
	letter-spacing: 0.02em;
}

.dispo-ev-tbc-sep {
	font-weight: 600;
	opacity: 0.9;
}

/* Tall custom tiles: keep harnesses in normal flow so they never cover each other */
.fc .fc-daygrid-event-harness {
	position: relative !important;
	top: auto !important;
	left: 0 !important;
	right: 0 !important;
	margin-top: 0 !important;
}

.fc .fc-daygrid-event-harness-abs {
	position: relative !important;
	left: 0 !important;
	right: 0 !important;
	width: auto !important;
	margin-right: 0 !important;
}

.fc .fc-daygrid-day-events {
	position: relative !important;
	min-height: 0 !important;
	margin: 0 !important;
}

.fc .fc-daygrid-day-bottom {
	margin-top: 0 !important;
}

.dispo-ev-time {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.dispo-ev {
	display: flex;
	flex-direction: column;
	gap: 0;
	width: 100%;
	color: inherit;
	background: transparent;
}

.dispo-ev.is-mine {
	background: transparent;
}

.dispo-ev-title {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.35rem;
	font-weight: 600;
	font-size: 0.78rem;
	padding: 0.28rem 0.4rem;
	background: var(--job-color, #2a6f4e);
	color: #000;
	border-radius: 3px 3px 0 0;
}

.dispo-ev-title-btn {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}

.dispo-ev-title-btn:hover .dispo-ev-title-text,
.dispo-ev-title-btn:focus-visible .dispo-ev-title-text {
	text-decoration: underline;
}

.dispo-ev-title-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.05rem;
}

.dispo-ev-type {
	display: block;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.15;
	opacity: 0.95;
}

.dispo-ev-title-text {
	flex: 1 1 auto;
	min-width: 0;
	word-break: break-word;
}

.dispo-ev-body {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 0.28rem 0.4rem 0.35rem;
	color: var(--ink, #1a1a1a);
}

.dispo-ev.no-foot .dispo-ev-body {
	border-radius: 0 0 3px 3px;
}

.dispo-ev.no-foot .dispo-ev-title:only-child,
.dispo-ev.no-foot .dispo-ev-title:last-child {
	border-radius: 3px;
}

.dispo-ev-pin {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.22);
	color: #fff;
	text-decoration: none;
}

.dispo-ev-pin:hover {
	background: rgba(255, 255, 255, 0.4);
}

.dispo-ev-pin .dispo-ico {
	width: 14px;
	height: 14px;
}

.dispo-ico {
	flex: 0 0 auto;
	display: inline-block;
	vertical-align: -0.1em;
	opacity: 0.9;
}

.dispo-ev-contact {
	opacity: 0.95;
}

.dispo-ev-contact .ev-ap {
	font-weight: 700;
	margin-right: 0.15rem;
}

.dispo-ev-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 0.4rem;
	opacity: 0.95;
}

.dispo-ev-users,
.dispo-ev-vehicles,
.dispo-ev-external {
	display: flex;
	align-items: flex-start;
	gap: 0.3rem;
	flex: 1 1 auto;
	min-width: 0;
	word-break: break-word;
}

.dispo-ev-users span,
.dispo-ev-vehicles span,
.dispo-ev-external span {
	min-width: 0;
}

.dispo-ev-external {
	opacity: 0.95;
}

.dispo-ev-admin {
	flex: 0 1 auto;
	text-align: right;
	max-width: 42%;
	opacity: 0.95;
}

.dispo-ev-loc {
	opacity: 0.9;
	word-break: break-word;
}

.dispo-ev-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.2rem;
	padding: 0;
	background: var(--job-color, #2a6f4e);
	border-radius: 0 0 3px 3px;
	min-height: 0;
}

.dispo-ev-foot-left,
.dispo-ev-foot-right {
	display: flex;
	align-items: center;
	gap: 0.2rem;
}

.dispo-ev-foot-left {
	justify-content: flex-start;
}

.dispo-ev-foot-right {
	justify-content: flex-end;
	margin-left: auto;
}

.dispo-ev-foot-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.08rem;
	height: 1.08rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
	cursor: pointer;
	text-decoration: none;
	line-height: 0;
}

.dispo-ev-foot-btn:hover,
.dispo-ev-foot-btn:focus-visible {
	background: rgba(255, 255, 255, 0.38);
	outline: none;
}

.dispo-ev-foot-btn .dispo-ico {
	opacity: 1;
	width: 11px;
	height: 11px;
}

.job-pop {
	position: fixed;
	z-index: 10000;
	max-width: min(18rem, calc(100vw - 1rem));
	min-width: 12rem;
	pointer-events: auto;
}

.job-pop-card {
	background: #fff;
	border: 1px solid var(--line, #d5dde3);
	border-radius: 10px;
	box-shadow: var(--shadow, 0 8px 28px rgba(20, 30, 38, 0.18));
	padding: 0.7rem 0.8rem;
	font-size: 0.82rem;
	color: var(--ink, #1a1a1a);
	display: grid;
	gap: 0.35rem;
}

.job-pop-title {
	display: block;
	font-size: 0.95rem;
	line-height: 1.25;
	word-break: break-word;
	color: var(--ink);
}

.job-pop-row {
	display: grid;
	gap: 0.1rem;
}

.job-pop-label {
	color: var(--muted);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.job-pop-row > :last-child {
	min-width: 0;
	word-break: break-word;
}

.job-pop-empty {
	color: var(--muted);
	font-style: italic;
}

.modal {
	border: none;
	border-radius: 12px;
	padding: 0;
	max-width: min(560px, calc(100vw - 2rem));
	width: 100%;
	box-shadow: var(--shadow);
	background: #fff;
}

#quick-insert.modal {
	max-width: min(920px, calc(100vw - 2rem));
}

.modal.modal-sm {
	max-width: min(380px, calc(100vw - 2rem));
}

.modal-footer-start {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.qi-form-layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem 1.5rem;
	align-items: start;
}

.qi-col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem 1rem;
	align-content: start;
}

.qi-col label {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	font-size: 0.85rem;
	color: var(--muted);
}

.qi-col label.qi-check {
	flex-direction: row;
	align-items: center;
	gap: 0.45rem;
	align-self: end;
	min-height: 2.35rem;
	font-weight: 600;
	color: var(--ink);
	cursor: pointer;
	user-select: none;
}

.qi-col label.qi-check input {
	width: 1rem;
	height: 1rem;
	margin: 0;
	accent-color: var(--accent);
}

.qi-type-field {
	position: relative;
}

.qi-type-select {
	position: relative;
}

.qi-type-select-native {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
	opacity: 0;
	pointer-events: none;
}

.qi-type-select-btn {
	appearance: none;
	display: flex;
	align-items: center;
	gap: 0.45rem;
	width: 100%;
	font: inherit;
	color: var(--ink);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 0.45rem 0.55rem;
	background: #fff;
	cursor: pointer;
	text-align: left;
}

.qi-type-select-btn:hover,
.qi-type-select.is-open .qi-type-select-btn {
	border-color: var(--muted);
}

.qi-type-select-btn:focus-visible {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(31, 107, 74, 0.15);
}

.qi-type-swatch {
	flex: 0 0 auto;
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.12);
	display: inline-block;
}

.qi-type-label {
	flex: 1 1 auto;
	min-width: 0;
}

.qi-type-select-menu {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 0.25rem);
	z-index: 50;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0.35rem;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: #fff;
	box-shadow: var(--shadow);
	max-height: 14rem;
	overflow: auto;
}

.qi-type-select-menu[hidden] {
	display: none !important;
}

.qi-type-option {
	appearance: none;
	display: flex;
	align-items: center;
	gap: 0.45rem;
	width: 100%;
	margin: 0;
	padding: 0.4rem 0.5rem;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--ink);
	font: inherit;
	font-size: 0.9rem;
	text-align: left;
	cursor: pointer;
}

.qi-type-option:hover,
.qi-type-option:focus-visible {
	background: #f4f7f9;
	outline: none;
}

.qi-type-option[aria-selected="true"] {
	background: rgba(31, 107, 74, 0.1);
	font-weight: 600;
}

.qi-col .span-2,
.qi-col fieldset.span-2,
.qi-col .error.span-2 {
	grid-column: 1 / -1;
}

.qi-col fieldset {
	margin: 0;
	padding: 0.55rem 0.65rem 0.7rem;
	border: 1px solid var(--line);
	border-radius: 8px;
}

.qi-col fieldset legend {
	padding: 0 0.25rem;
	font-size: 0.8rem;
	color: var(--muted);
}

.modal::backdrop {
	background: rgba(20, 30, 38, 0.45);
}

.modal-inner { margin: 0; }
.modal-inner header,
.modal-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.9rem 1.1rem;
	border-bottom: 1px solid var(--line);
}

.modal-footer {
	border-bottom: none;
	border-top: 1px solid var(--line);
	justify-content: space-between;
}

.modal-footer-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-left: auto;
}

.btn.danger {
	background: #fff;
	border-color: #b03430;
	color: #b03430;
}

.btn.danger:hover,
.btn.danger:focus-visible {
	background: #b03430;
	border-color: #b03430;
	color: #fff;
}

.modal-inner h2 {
	margin: 0;
	font-family: var(--font-display);
	font-size: 1.25rem;
}

.modal-body { padding: 1rem 1.1rem 1.2rem; }

.icon-close {
	border: none;
	background: transparent;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: var(--muted);
}

.form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem 1rem;
}

.form-grid label {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	font-size: 0.85rem;
	color: var(--muted);
}

.form-grid .span-2 { grid-column: 1 / -1; }

.form-grid input:not([type="checkbox"]):not([type="radio"]),
.form-grid select,
.form-grid textarea,
.qi-col input:not([type="checkbox"]):not([type="radio"]),
.qi-col select,
.qi-col textarea,
.ics-url {
	font: inherit;
	color: var(--ink);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 0.45rem 0.55rem;
	background: #fff;
}

.form-grid input:not([type="checkbox"]):not([type="radio"]):focus,
.form-grid select:focus,
.form-grid textarea:focus,
.qi-col input:not([type="checkbox"]):not([type="radio"]):focus,
.qi-col select:focus,
.qi-col textarea:focus,
.ics-url:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(31, 107, 74, 0.15);
}

.loc-field .field-hint,
.field-hint {
	display: block;
	margin-top: 0.25rem;
	font-size: 0.75rem;
	color: var(--muted);
}

#qi-maps-wrap[hidden],
.field-hint[hidden] {
	display: none !important;
}

.user-picker, .chip-picker {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.user-option, .chip-option {
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 0.35rem 0.55rem;
	font-size: 0.82rem;
	background: #f7fafb;
	cursor: pointer;
	display: inline-flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 7rem;
}

.user-option input, .chip-option input { margin-right: 0.35rem; }

.user-option.available,
.chip-option.available {
	border-color: #8fbfa4;
	background: #eef7f2;
}
.user-option.busy,
.chip-option.busy {
	border-color: #d2b48c;
	background: #fbf4e8;
	opacity: 0.95;
}
.user-option.away {
	border-color: #c47a7a;
	background: #f8e4e4;
}

.badge {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted);
}

.badge.ok { color: var(--accent); }
.badge.busy { color: var(--warn); }

.qi-flags {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
}

.qi-flag.flag-holiday { color: #c62828; }
.qi-flag.flag-school { color: #1e4d7b; }
.qi-flag.flag-spare { color: #2a5a2a; }
.qi-flag.flag-sick { color: #e67e22; }

.error {
	color: var(--danger);
	font-size: 0.9rem;
}

.hint { color: var(--muted); font-size: 0.85rem; }

.detail-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
}

.detail-table thead th {
	text-align: left;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted);
	padding: 0 0.75rem 0.55rem 0;
	border-bottom: 1px solid var(--line);
}

.detail-table thead th:last-child {
	padding-right: 0;
	padding-left: 0.75rem;
}

.detail-table tbody th,
.detail-table tbody td {
	padding: 0.55rem 0.75rem 0.55rem 0;
	vertical-align: top;
	border-bottom: 1px solid var(--line);
	text-align: left;
}

.detail-table tbody th {
	width: 38%;
	color: var(--muted);
	font-weight: 500;
	padding-right: 0.75rem;
}

.detail-table tbody td {
	padding-left: 0.75rem;
	padding-right: 0;
	color: var(--ink);
	word-break: break-word;
}

.detail-table tbody tr:last-child th,
.detail-table tbody tr:last-child td {
	border-bottom: 0;
}

.login-page {
	display: grid;
	place-items: center;
	min-height: 100vh;
	padding: 1.5rem;
}

.login-card {
	width: min(400px, 100%);
	padding: 1.75rem;
	border-radius: 14px;
	background: var(--card);
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
}

.login-card h1 {
	margin: 0 0 0.35rem;
	font-family: var(--font-display);
}

.lede { color: var(--muted); margin-top: 0; }

.login-form {
	display: grid;
	gap: 0.75rem;
	margin: 1.25rem 0;
}

.login-form label {
	display: grid;
	gap: 0.3rem;
	font-size: 0.85rem;
	color: var(--muted);
}

.login-form input {
	font: inherit;
	padding: 0.55rem 0.65rem;
	border-radius: 8px;
	border: 1px solid var(--line);
}

.login-form button {
	margin-top: 0.35rem;
	background: var(--accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 0.65rem;
	font: inherit;
	cursor: pointer;
}

@media (max-width: 900px) {
	.qi-form-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
	.form-grid { grid-template-columns: 1fr; }
	.form-grid .span-2 { grid-column: auto; }
	.qi-form-layout { grid-template-columns: 1fr; }
	.qi-col { grid-template-columns: 1fr; }
	.qi-col .span-2,
	.qi-col fieldset.span-2,
	.qi-col .error.span-2 { grid-column: auto; }
	#calendar { margin: 0 0.5rem; padding: 0.4rem; }
	.app-header, .toolbar, .planner-bar { padding-left: 0.85rem; padding-right: 0.85rem; }
	.dashboard-main { padding-left: 0.85rem; padding-right: 0.85rem; }
	.dashboard-table { min-width: 40rem; }
}

/* —— Dashboard (my upcoming jobs) —— */
.dashboard-main {
	padding: 1.25rem 1.4rem 2rem;
	max-width: 1100px;
	width: 100%;
	margin: 0 auto;
}

.dashboard-heading h1 {
	margin: 0;
	font-family: var(--font-display);
	font-size: 1.65rem;
	line-height: 1.2;
}

.dashboard-heading .lede {
	margin: 0.25rem 0 1rem;
	color: var(--muted);
	font-size: 0.95rem;
}

.dashboard-toolbar {
	margin: 0 0 0.85rem;
	padding: 0;
	border: 0;
	background: transparent;
	justify-content: flex-end;
}

.dashboard-table-wrap {
	overflow-x: auto;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.dashboard-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.dashboard-table th,
.dashboard-table td {
	padding: 0.7rem 0.85rem;
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid var(--line);
}

.dashboard-table thead th {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--muted);
	font-weight: 600;
	background: rgba(255, 255, 255, 0.55);
	white-space: nowrap;
}

.dashboard-table tbody tr:last-child td {
	border-bottom: 0;
}

.dashboard-table tbody tr.dashboard-job-row.is-stripe > td {
	background: rgba(90, 107, 120, 0.07);
}

.dashboard-table .col-date,
.dashboard-table .col-time {
	white-space: nowrap;
}

.dashboard-table .col-job {
	font-weight: 600;
}

.dashboard-table .col-date {
	font-weight: 600;
}

/* Soft separators between same-day jobs; keep full border on date/link rowspan */
.dashboard-job-group:not(.is-last) > td:not(.col-date):not(.col-link) {
	border-bottom-color: rgba(197, 208, 216, 0.45);
}

.dashboard-job-group.is-first > td.col-date,
.dashboard-job-group.is-first > td.col-link {
	border-bottom: 1px solid var(--line);
}

.dashboard-flag-row > td {
	font-weight: 700;
	letter-spacing: 0.02em;
}

.dashboard-flag-row .col-flag {
	text-transform: uppercase;
	font-size: 0.82rem;
}

.dashboard-flag-row.flag-holiday > td {
	background: #f3e8e8;
	color: #7a3030;
}

.dashboard-flag-row.flag-school > td {
	background: #e7eef6;
	color: #1e4d7b;
}

.dashboard-flag-row.flag-spare > td {
	background: #eef6ea;
	color: #2a5a2a;
}

.dashboard-flag-row.flag-sick > td {
	background: #fff0e0;
	color: #b35a00;
}

.dashboard-type {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.dashboard-type .swatch {
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 2px;
	flex: 0 0 auto;
}

.dashboard-who {
	display: grid;
	gap: 0.25rem;
}

.dashboard-who-staff,
.dashboard-who-ext {
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.dashboard-who-staff .dispo-ico,
.dashboard-who-ext .dispo-ico {
	flex: 0 0 auto;
}

.dashboard-who-ext {
	opacity: 0.95;
}

.dashboard-table .col-link .btn {
	white-space: nowrap;
	font-weight: 400;
}

.dashboard-flag-row .col-link .btn {
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
}
