/* RockWell Calendar — Outlook-style week view + phone agenda */

:root {
	--ol-bg: #f3f2f1;
	--ol-surface: #ffffff;
	--ol-ink: #242424;
	--ol-muted: #616161;
	--ol-line: #e1dfdd;
	--ol-line-strong: #c8c6c4;
	--ol-accent: #0078d4;
	--ol-accent-hover: #106ebe;
	--ol-today: #0078d4;
	--ol-danger: #a4262c;
	--ol-ok: #0b6a0b;
	--ol-font: "Segoe UI", "Segoe UI Web (West European)", system-ui, -apple-system, sans-serif;
	--ol-gutter: 56px;
}

* { box-sizing: border-box; }

html.schedule-html,
body.schedule-body {
	margin: 0;
	min-height: 100%;
	background: var(--ol-bg);
	color: var(--ol-ink);
	font-family: var(--ol-font);
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
}

body.schedule-body:not(.schedule-body--director):not(.schedule-body--login) {
	padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

body.schedule-body--director {
	padding-bottom: 0;
	overflow: hidden;
	height: 100vh;
}

body.schedule-body--login {
	padding-bottom: 0;
}

/* —— Buttons —— */
.ol-btn,
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 32px;
	padding: 0 12px;
	border: 1px solid var(--ol-line-strong);
	border-radius: 2px;
	background: var(--ol-surface);
	color: var(--ol-ink);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}
.ol-btn:hover,
.btn:hover { background: #f5f5f5; }
.ol-btn--primary,
.btn-primary {
	background: var(--ol-accent);
	border-color: var(--ol-accent);
	color: #fff;
}
.ol-btn--primary:hover,
.btn-primary:hover { background: var(--ol-accent-hover); border-color: var(--ol-accent-hover); }
.ol-btn--danger { color: var(--ol-danger); border-color: var(--ol-line-strong); background: #fff; }
.ol-btn--danger:hover { background: #fde7e9; }
.ol-btn--ghost {
	border-color: transparent;
	background: transparent;
	min-width: 32px;
	padding: 0 8px;
	color: var(--ol-muted);
}
.ol-btn--icon { min-width: 32px; padding: 0; font-size: 1.25rem; line-height: 1; }
.ol-btn--block,
.btn-block { width: 100%; }
.btn-sm { min-height: 28px; font-size: 0.8125rem; }
.btn-secondary { background: #fff; }

/* —— Forms —— */
.ol-form label,
.schedule-create-form label,
.schedule-mileage-form label {
	display: block;
	margin-bottom: 12px;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--ol-muted);
}
.ol-form input,
.ol-form select,
.ol-form textarea,
.schedule-create-form input,
.schedule-create-form textarea,
.schedule-create-form select,
.schedule-mileage-form input,
.schedule-select {
	display: block;
	width: 100%;
	margin-top: 4px;
	padding: 7px 10px;
	border: 1px solid var(--ol-line-strong);
	border-radius: 2px;
	background: #fff;
	font: inherit;
	font-size: 0.9375rem;
	color: var(--ol-ink);
}
.ol-form input:focus,
.ol-form select:focus,
.ol-form textarea:focus {
	outline: 2px solid var(--ol-accent);
	outline-offset: -1px;
	border-color: var(--ol-accent);
}
.ol-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}
.ol-check {
	display: flex !important;
	align-items: center;
	gap: 8px;
	font-size: 0.875rem !important;
	font-weight: 400 !important;
	color: var(--ol-ink) !important;
}
.ol-check input { width: auto; margin: 0; }

/* —— Login —— */
.schedule-main--login {
	max-width: none;
	padding: 0;
	min-height: 100vh;
	display: flex;
}
.ol-login {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background:
		linear-gradient(180deg, #faf9f8 0%, var(--ol-bg) 100%);
}
.ol-login-panel {
	width: min(360px, 100%);
	background: #fff;
	border: 1px solid var(--ol-line);
	padding: 32px 28px 28px;
}
.ol-login-logo {
	display: block;
	margin-bottom: 20px;
}
.ol-login h1 {
	margin: 0 0 4px;
	font-size: 1.5rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}
.ol-login-sub {
	margin: 0 0 20px;
	font-size: 0.8125rem;
	color: var(--ol-muted);
}
.ol-alert {
	padding: 8px 10px;
	margin-bottom: 14px;
	font-size: 0.875rem;
	border: 1px solid transparent;
}
.ol-alert--ok { background: #dff6dd; border-color: #9fd89f; color: var(--ol-ok); }
.ol-alert--err { background: #fde7e9; border-color: #f1aeb5; color: var(--ol-danger); }

/* —— Director chrome —— */
.schedule-main--director {
	max-width: none;
	margin: 0;
	padding: 0;
	height: calc(100vh - 36px);
	display: flex;
	flex-direction: column;
}
.ol-account {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 36px;
	padding: 0 12px;
	background: #201f1e;
	color: #fff;
	font-size: 0.8125rem;
}
.ol-account img {
	filter: brightness(0) invert(1);
	opacity: 0.9;
}
.ol-account a {
	margin-left: auto;
	color: #c8c6c4;
	text-decoration: none;
}
.ol-account a:hover { color: #fff; }

.ol-shell {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	background: var(--ol-surface);
}

.ol-ribbon {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 12px;
	border-bottom: 1px solid var(--ol-line);
	background: #faf9f8;
}
.ol-ribbon-left,
.ol-ribbon-right {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}
.ol-app-name {
	font-weight: 600;
	font-size: 1rem;
	margin-right: 8px;
}
.ol-range {
	font-size: 0.9375rem;
	font-weight: 600;
	margin-left: 4px;
}
.ol-people {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-left: 8px;
	padding-left: 8px;
	border-left: 1px solid var(--ol-line);
}
.ol-person {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 0.75rem;
	color: var(--ol-muted);
}
.ol-dot {
	width: 10px;
	height: 10px;
	border-radius: 2px;
	display: inline-block;
}
.ol-dot--open {
	background: #fff;
	border: 1px dashed #605e5c;
}

.ol-workbench {
	display: grid;
	grid-template-columns: auto 1fr;
	flex: 1;
	min-height: 0;
}
.ol-compose {
	width: 300px;
	border-right: 1px solid var(--ol-line);
	background: #faf9f8;
	padding: 12px;
	overflow: auto;
}
.ol-compose[hidden] { display: none !important; }
.ol-compose-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

/* —— Outlook week grid —— */
.ol-week {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
	overflow: auto;
	background: #fff;
}
.ol-week-head {
	display: grid;
	grid-template-columns: var(--ol-gutter) repeat(7, minmax(100px, 1fr));
	position: sticky;
	top: 0;
	z-index: 5;
	background: #fff;
	border-bottom: 1px solid var(--ol-line-strong);
}
.ol-gutter-head { border-right: 1px solid var(--ol-line); }
.ol-day-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 8px 4px 10px;
	border-right: 1px solid var(--ol-line);
	text-align: center;
}
.ol-day-head.is-today { background: #f3f9fd; }
.ol-dow {
	font-size: 0.6875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ol-muted);
}
.ol-dom {
	margin-top: 2px;
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.125rem;
	font-weight: 600;
	border-radius: 50%;
}
.ol-dom.is-today {
	background: var(--ol-today);
	color: #fff;
}

.ol-week-body {
	display: grid;
	grid-template-columns: var(--ol-gutter) repeat(7, minmax(100px, 1fr));
	position: relative;
}
.ol-hours {
	border-right: 1px solid var(--ol-line);
	background: #fff;
}
.ol-hour {
	position: relative;
	border-bottom: 1px solid var(--ol-line);
}
.ol-hour span {
	position: absolute;
	top: -8px;
	right: 8px;
	font-size: 0.6875rem;
	color: var(--ol-muted);
}
.ol-day-col {
	position: relative;
	border-right: 1px solid var(--ol-line);
}
.ol-day-col.is-today { background: rgba(0, 120, 212, 0.03); }
.ol-slot {
	border-bottom: 1px solid var(--ol-line);
}

.ol-event {
	position: absolute;
	left: 2px;
	right: 2px;
	z-index: 2;
	min-height: 44px;
	height: 52px;
	padding: 3px 6px;
	border: none;
	border-left: 4px solid var(--ev);
	border-radius: 2px;
	background: color-mix(in srgb, var(--ev) 22%, #fff);
	color: var(--ol-ink);
	text-align: left;
	cursor: pointer;
	overflow: hidden;
	font: inherit;
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ev) 35%, transparent);
}
.ol-event:hover {
	filter: brightness(0.97);
	z-index: 3;
}
.ol-event.is-open {
	background: repeating-linear-gradient(
		-45deg,
		#faf9f8,
		#faf9f8 4px,
		#f0f0f0 4px,
		#f0f0f0 8px
	);
	border-left-color: #605e5c;
	box-shadow: inset 0 0 0 1px #c8c6c4;
}
.ol-event-time,
.ol-event-who {
	display: block;
	font-size: 0.6875rem;
	color: var(--ol-muted);
	line-height: 1.2;
}
.ol-event-title {
	display: block;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* —— Event dialog —— */
.ol-dialog {
	border: 1px solid var(--ol-line-strong);
	border-radius: 2px;
	padding: 0;
	width: min(440px, calc(100vw - 24px));
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14);
}
.ol-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
.ol-dialog-form { padding: 0; }
.ol-dialog-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	border-bottom: 1px solid var(--ol-line);
	background: #faf9f8;
}
.ol-dialog-head > div {
	display: flex;
	align-items: center;
	gap: 8px;
}
.ol-dialog-swatch {
	width: 12px;
	height: 12px;
	border-radius: 2px;
	background: #605e5c;
}
.ol-dialog .ol-form { padding: 14px; }
.ol-dialog-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 14px;
	border-top: 1px solid var(--ol-line);
	background: #faf9f8;
}
.ol-dialog-foot-right { display: flex; gap: 8px; }

.ol-flash {
	padding: 8px 14px;
	font-size: 0.875rem;
}
.ol-flash--ok { background: #dff6dd; color: var(--ol-ok); }
.ol-flash--err { background: #fde7e9; color: var(--ol-danger); }

/* —— Phone app —— */
.schedule-main {
	max-width: 640px;
	margin: 0 auto;
	padding: 16px;
}
.app-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 14px;
	padding-top: calc(8px + env(safe-area-inset-top, 0px));
	background: #fff;
	border-bottom: 1px solid var(--ol-line);
}
.app-brand img { display: block; }
.app-top-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 0.8125rem;
}
.app-link {
	color: var(--ol-accent);
	text-decoration: none;
	font-weight: 600;
}
.app-user { color: var(--ol-muted); }

.app-page-head { margin-bottom: 14px; }
.app-page-head h1 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 600;
}
.app-date,
.app-sub {
	margin: 0 0 2px;
	font-size: 0.8125rem;
	color: var(--ol-muted);
}
.app-callout {
	display: block;
	padding: 10px 12px;
	margin-bottom: 14px;
	background: #fff;
	border: 1px solid var(--ol-line-strong);
	border-left: 3px solid var(--ol-accent);
	color: var(--ol-ink);
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 600;
}
.app-empty {
	padding: 28px 12px;
	text-align: center;
	color: var(--ol-muted);
	background: #fff;
	border: 1px solid var(--ol-line);
}
.app-agenda {
	list-style: none;
	margin: 0;
	padding: 0;
	background: #fff;
	border: 1px solid var(--ol-line);
}
.app-agenda-item {
	display: grid;
	grid-template-columns: 64px 1fr;
	gap: 10px;
	padding: 12px;
	border-bottom: 1px solid var(--ol-line);
	border-left: 4px solid var(--ev, #0078d4);
}
.app-agenda-item:last-child { border-bottom: none; }
.app-agenda-item.is-open { border-left-style: dashed; }
.app-agenda-time {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--ol-muted);
}
.app-agenda-body strong {
	display: block;
	font-size: 0.9375rem;
	margin-bottom: 2px;
}
.app-agenda-body p {
	margin: 0 0 4px;
	font-size: 0.875rem;
	color: var(--ol-muted);
}
.app-agenda-meta { font-size: 0.8125rem !important; }
.app-agenda-notes { color: var(--ol-ink) !important; }
.app-agenda-link {
	display: inline-block;
	margin-top: 6px;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--ol-accent);
	text-decoration: none;
}
.schedule-claim-form { margin-top: 8px; }

.app-nav {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	background: #fff;
	border-top: 1px solid var(--ol-line);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	z-index: 20;
}
.app-nav-link {
	padding: 12px 8px;
	text-align: center;
	text-decoration: none;
	color: var(--ol-muted);
	font-size: 0.8125rem;
	font-weight: 600;
}
.app-nav-link.is-active {
	color: var(--ol-accent);
	box-shadow: inset 0 2px 0 var(--ol-accent);
}

/* —— Mileage (reuse tidy chrome) —— */
.schedule-page--mileage .schedule-hero h1,
.schedule-hero h1 {
	margin: 0 0 4px;
	font-size: 1.5rem;
	font-weight: 600;
}
.schedule-kicker,
.schedule-lead { color: var(--ol-muted); font-size: 0.875rem; }
.schedule-kicker { margin: 0 0 2px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.schedule-lead { margin: 0 0 14px; }
.card {
	background: #fff;
	border: 1px solid var(--ol-line);
	border-radius: 2px;
	padding: 14px;
	box-shadow: none;
}
.schedule-mileage-form input[type="text"] {
	border-radius: 2px;
}
.schedule-map {
	height: 220px;
	border: 1px solid var(--ol-line);
	border-radius: 2px;
	overflow: hidden;
	margin: 12px 0;
}
.schedule-map--tall { height: 280px; }
.schedule-quote {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin: 0;
}
.schedule-quote dt {
	margin: 0;
	font-size: 0.75rem;
	color: var(--ol-muted);
}
.schedule-quote dd {
	margin: 2px 0 0;
	font-weight: 600;
}
.schedule-quote-total {
	grid-column: 1 / -1;
	padding-top: 8px;
	border-top: 1px solid var(--ol-line);
}
.schedule-claims-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.schedule-claims-list a {
	display: grid;
	grid-template-columns: 1fr auto;
	padding: 10px 0;
	border-top: 1px solid var(--ol-line);
	text-decoration: none;
	color: inherit;
}
.schedule-expense-table {
	width: 100%;
	border-collapse: collapse;
}
.schedule-expense-table th,
.schedule-expense-table td {
	padding: 8px 0;
	border-bottom: 1px solid var(--ol-line);
	text-align: left;
}
.schedule-expense-actions {
	display: flex;
	gap: 8px;
	margin-top: 14px;
}
.schedule-linked-job {
	padding: 10px;
	margin-bottom: 12px;
	background: #f3f9fd;
	border: 1px solid #c7e0f4;
	font-size: 0.875rem;
}
.schedule-tag {
	display: inline-block;
	font-size: 0.6875rem;
	font-weight: 600;
	color: var(--ol-accent);
	margin-bottom: 4px;
}
.muted { color: var(--ol-muted); }

@media (max-width: 900px) {
	.ol-workbench { grid-template-columns: 1fr; }
	.ol-compose {
		width: 100%;
		border-right: none;
		border-bottom: 1px solid var(--ol-line);
	}
	.ol-people { display: none; }
	body.schedule-body--director {
		height: auto;
		overflow: auto;
	}
	.schedule-main--director { height: auto; }
}

@media print {
	.app-top, .app-nav, .ol-account, .ol-ribbon, .ol-flash { display: none !important; }
}
