:root {
	--bg: #f5f6fb;
	--surface: #ffffff;
	--border: #e4e7f1;
	--navy: #161b33;
	--text: #333b52;
	--muted: #7b8299;
	--brand: #4b4fe0;
	--brand-dark: #3a3dc2;
	--brand-tint: #eeeefc;
	--available: #12a594;
	--available-tint: #e3f6f2;
	--booked: #e8734a;
	--booked-tint: #fdebe2;
	--pending: #c98a00;
	--pending-tint: #fff3d6;
	--rejected: #a9aebe;
	--rejected-tint: #f1f2f7;
	--past: #c7cbd9;
	--past-tint: #f1f2f7;
	--radius-lg: 18px;
	--radius-md: 12px;
	--radius-sm: 8px;
	--shadow: 0 2px 6px rgba(22, 27, 51, 0.04), 0 8px 24px rgba(22, 27, 51, 0.06);
	--font-display: "Space Grotesk", sans-serif;
	--font-body: "Inter", sans-serif;
	--font-mono: "IBM Plex Mono", monospace;
}

* {
	box-sizing: border-box;
}
html,
body {
	margin: 0;
	padding: 0;
}
body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	-webkit-font-smoothing: antialiased;
}

.muted {
	color: var(--muted);
}
.muted-inline {
	color: var(--muted);
	font-weight: 400;
	font-size: 12.5px;
}

/* LAYOUT */
.app {
	display: grid;
	grid-template-columns: 260px 1fr;
	min-height: 100vh;
	transition: grid-template-columns 0.22s ease;
}

/* SIDEBAR TOGGLE (collapse/hide) */
body.sidebar-collapsed .app {
	grid-template-columns: 0px 1fr;
}
body.sidebar-collapsed .sidebar {
	padding: 28px 0;
	opacity: 0;
	overflow: hidden;
	pointer-events: none;
}

.sidebar-toggle {
	position: fixed;
	top: 26px;
	left: 244px;
	z-index: 40;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--surface);
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--navy);
	transition: left 0.22s ease, background 0.15s ease, color 0.15s ease;
}
.sidebar-toggle:hover {
	background: var(--brand-tint);
	color: var(--brand);
}
.sidebar-toggle svg {
	transition: transform 0.22s ease;
}
body.sidebar-collapsed .sidebar-toggle {
	left: 12px;
}
body.sidebar-collapsed .sidebar-toggle svg {
	transform: rotate(180deg);
}

/* SIDEBAR */
.sidebar {
	background: var(--navy);
	color: #fff;
	padding: 28px 20px;
	display: flex;
	flex-direction: column;
	gap: 32px;
	position: sticky;
	top: 0;
	height: 100vh;
	transition: padding 0.22s ease, opacity 0.18s ease;
}
.brand {
	display: flex;
	align-items: center;
	gap: 12px;
}
.brand-mark {
	width: 40px;
	height: 40px;
	border-radius: 11px;
	background: linear-gradient(135deg, var(--brand), #7b7ef0);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	flex-shrink: 0;
}
.brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}
.brand-name {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 17px;
}
.brand-sub {
	font-size: 11.5px;
	color: #9096b8;
}

.menu {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.menu-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #6c7395;
	margin: 0 12px 8px;
}
.menu-item {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 10px 12px;
	border-radius: 10px;
	color: #c4c8de;
	text-decoration: none;
	font-size: 14.5px;
	font-weight: 500;
	transition:
		background 0.15s ease,
		color 0.15s ease;
}
.menu-item svg {
	flex-shrink: 0;
	opacity: 0.85;
}
.menu-item:hover {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
}
.menu-item.active {
	background: var(--brand);
	color: #fff;
}
.menu-item.logout {
	margin-top: auto;
}

/* MAIN */
.main {
	padding: 36px 44px 60px;
	width: 100%;
	max-width: none;
	min-width: 0; /* grid items default to min-width:auto, which lets wide
	                 children (like .timeline) force this whole column —
	                 and the page — wider than the viewport on mobile */
	overflow-x: hidden;
}

.topbar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 26px;
	flex-wrap: wrap;
	gap: 16px;
}
.topbar h1 {
	font-family: var(--font-display);
	font-size: 26px;
	font-weight: 700;
	margin: 0 0 4px;
	color: var(--navy);
}
.topbar p {
	margin: 0;
	font-size: 14px;
}

/* ---------- Notification bell (admin) ---------- */
.notif-bell-wrap {
	position: relative;
}
.notif-bell {
	position: relative;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--navy);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: var(--shadow);
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.notif-bell:hover,
.notif-bell.is-open {
	background: var(--brand-tint);
	border-color: var(--brand);
	color: var(--brand-dark);
}
.notif-badge {
	position: absolute;
	top: -3px;
	right: -3px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 100px;
	background: var(--booked);
	color: #fff;
	font-size: 10.5px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	border: 2px solid var(--bg);
}

.notif-panel {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	width: 340px;
	max-width: calc(100vw - 40px);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: 0 12px 32px rgba(20, 30, 60, 0.14);
	z-index: 60;
	overflow: hidden;
}
.notif-panel-head {
	padding: 14px 16px;
	border-bottom: 1px solid var(--border);
	font-size: 13.5px;
	color: var(--navy);
}
.notif-panel-list {
	max-height: 320px;
	overflow-y: auto;
}
.notif-item {
	display: block;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
	text-decoration: none;
	color: inherit;
	transition: background 0.12s ease;
}
.notif-item:last-child {
	border-bottom: none;
}
.notif-item:hover {
	background: var(--brand-tint);
}
.notif-item-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--navy);
	margin-bottom: 3px;
}
.notif-item-sub {
	font-size: 12px;
	color: var(--muted);
}
.notif-empty {
	padding: 28px 16px;
	text-align: center;
	font-size: 13px;
	color: var(--muted);
}
.notif-panel-foot {
	display: block;
	padding: 11px 16px;
	text-align: center;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--brand);
	text-decoration: none;
	border-top: 1px solid var(--border);
	background: #fafbff;
}
.notif-panel-foot:hover {
	background: var(--brand-tint);
}

@media (max-width: 560px) {
	.notif-panel {
		position: fixed;
		top: 70px;
		left: 12px;
		right: 12px;
		width: auto;
		max-width: none;
	}
}

.profile-chip {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--surface);
	border: 1px solid var(--border);
	padding: 8px 14px 8px 8px;
	border-radius: 100px;
	box-shadow: var(--shadow);
}
.profile-chip img {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--brand-tint);
}
.profile-chip div {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}
.profile-name {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--navy);
}
.profile-role {
	font-size: 11.5px;
	color: var(--muted);
}

/* STATS */
.stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-bottom: 26px;
}
.stat-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	padding: 18px 20px;
	box-shadow: var(--shadow);
}
.stat-num {
	font-family: var(--font-display);
	font-size: 28px;
	font-weight: 700;
	color: var(--navy);
	display: block;
}
.stat-label {
	font-size: 13px;
	color: var(--muted);
}

/* DATE CONTROL */
.date-control {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}
.date-nav {
	display: flex;
	align-items: center;
	gap: 8px;
}
.date-nav input[type="date"] {
	font-family: var(--font-mono);
	font-size: 13.5px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 8px 10px;
	background: var(--surface);
	color: var(--text);
}
.icon-btn {
	width: 34px;
	height: 34px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--navy);
	font-size: 17px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}
.icon-btn:hover {
	background: var(--brand-tint);
	border-color: var(--brand);
}

.btn-ghost {
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--navy);
	font-weight: 600;
	font-size: 13.5px;
	padding: 8px 16px;
	border-radius: var(--radius-sm);
	cursor: pointer;
}
.btn-ghost:hover {
	background: var(--brand-tint);
	border-color: var(--brand);
	color: var(--brand-dark);
}

.legend {
	display: flex;
	flex-wrap: wrap;
	row-gap: 8px;
	gap: 16px;
	margin-left: auto;
	font-size: 13px;
	color: var(--muted);
}
.legend-item {
	display: flex;
	align-items: center;
	gap: 6px;
}
.dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	display: inline-block;
}
.dot-available {
	background: var(--available);
}
.dot-approved {
	background: var(--booked);
}
.dot-pending {
	background: var(--pending);
}
.dot-rejected {
	background: var(--rejected);
}
.dot-booked {
	background: var(--booked);
}
.dot-past {
	background: var(--past);
}

/* TIMELINE — signature element */
.timeline-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	padding: 6px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x pan-y;
	margin-bottom: 12px;
}
@media (max-width: 900px) {
	.timeline-card {
		background-image:
			linear-gradient(to right, var(--surface) 0%, rgba(255, 255, 255, 0) 4%),
			linear-gradient(to left, var(--surface) 0%, rgba(255, 255, 255, 0) 4%);
		background-position: left, right;
		background-repeat: no-repeat;
		background-size: 24px 100%, 24px 100%;
		background-attachment: local, local;
	}
}
.timeline {
	display: grid;
	grid-template-columns: 160px repeat(4, minmax(150px, 1fr));
	min-width: 760px;
}
.tl-corner,
.tl-head {
	padding: 14px 16px;
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border-bottom: 1px solid var(--border);
}
.tl-head {
	font-family: var(--font-mono);
	color: var(--navy);
	text-align: center;
	text-transform: none;
	letter-spacing: 0;
	font-size: 13px;
}
.tl-room {
	padding: 16px;
	border-bottom: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
}
.tl-room-name {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 15px;
	color: var(--navy);
}
.tl-room-loc {
	font-size: 12px;
	color: var(--muted);
}
.tl-room-cap {
	font-size: 11.5px;
	color: var(--muted);
	display: flex;
	align-items: center;
	gap: 4px;
	margin-top: 2px;
}

.tl-cell {
	margin: 6px;
	border-radius: var(--radius-sm);
	min-height: 64px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	gap: 2px;
	cursor: pointer;
	border: 1.5px dashed transparent;
	transition:
		transform 0.12s ease,
		box-shadow 0.12s ease;
	font-size: 12.5px;
	padding: 6px;
}
.tl-cell.available {
	background: var(--available-tint);
	color: #0b7a6d;
	border-color: transparent;
}
.tl-cell.available:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(18, 165, 148, 0.18);
	border-color: var(--available);
}
.tl-cell.available .tl-plus {
	font-size: 16px;
	font-weight: 700;
}
.tl-cell.approved {
	background: var(--booked-tint);
	color: #b3502c;
	cursor: pointer;
	border: 1.5px solid transparent;
}
.tl-cell.approved:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(232, 115, 74, 0.18);
}
.tl-cell.approved .tl-pic {
	font-weight: 700;
	font-size: 12.5px;
}
.tl-cell.approved .tl-agenda {
	font-size: 11px;
	opacity: 0.85;
	max-width: 130px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tl-cell.approved .tl-status {
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-top: 1px;
}

.tl-cell.pending {
	background: var(--pending-tint);
	color: #8a5a00;
	cursor: pointer;
	border: 1.5px dashed var(--pending);
}
.tl-cell.pending:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(201, 138, 0, 0.18);
}
.tl-cell.pending .tl-pic {
	font-weight: 700;
	font-size: 12.5px;
}
.tl-cell.pending .tl-agenda {
	font-size: 11px;
	opacity: 0.85;
	max-width: 130px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tl-cell.pending .tl-status {
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-top: 1px;
}

.tl-cell.rejected {
	background: var(--rejected-tint);
	color: #7c8194;
	cursor: pointer;
	border: 1.5px dashed var(--rejected);
}
.tl-cell.rejected:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(169, 174, 190, 0.18);
}
.tl-cell.rejected .tl-pic {
	font-weight: 600;
	font-size: 12.5px;
	text-decoration: line-through;
	text-decoration-color: var(--rejected);
}
.tl-cell.rejected .tl-agenda {
	font-size: 11px;
	opacity: 0.8;
	max-width: 130px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tl-cell.rejected .tl-status {
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-top: 1px;
}

.tl-cell.past {
	background: var(--past-tint);
	color: var(--muted);
	cursor: not-allowed;
}

/* ---------- Mobile timeline: stacked cards instead of a wide grid ---------- */
.timeline-mobile {
	display: none;
}

@media (max-width: 700px) {
	.timeline {
		display: none;
	}
	.timeline-card {
		background-image: none; /* the desktop scroll-edge hint isn't needed once it's cards */
		overflow-x: visible;
		padding: 4px;
	}
	.timeline-mobile {
		display: block;
	}

	.tlm-room {
		border: 1px solid var(--border);
		border-radius: var(--radius-md);
		margin: 10px;
		overflow: hidden;
	}
	.tlm-room-head {
		padding: 14px 16px;
		background: #fafafd;
		border-bottom: 1px solid var(--border);
		display: flex;
		flex-direction: column;
		gap: 2px;
	}
	.tlm-room-name {
		font-family: var(--font-display);
		font-weight: 600;
		font-size: 15px;
		color: var(--navy);
	}
	.tlm-room-loc {
		font-size: 12px;
		color: var(--muted);
	}
	.tlm-room-cap {
		font-size: 11.5px;
		color: var(--muted);
		margin-top: 2px;
	}

	.tlm-slots {
		display: flex;
		flex-direction: column;
	}
	.tlm-slot {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 13px 16px;
		border-bottom: 1px dashed var(--border);
		cursor: pointer;
		font-size: 13px;
		min-height: 44px; /* comfortable tap target */
	}
	.tlm-slot:last-child {
		border-bottom: none;
	}
	.tlm-slot-time {
		font-family: var(--font-mono);
		font-size: 13px;
		color: var(--navy);
		font-weight: 600;
		flex-shrink: 0;
	}
	.tlm-slot-info {
		text-align: right;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.tlm-slot.available {
		background: var(--available-tint);
	}
	.tlm-slot.available .tlm-slot-info {
		color: #0b7a6d;
		font-weight: 600;
	}
	.tlm-slot.approved {
		background: var(--booked-tint);
	}
	.tlm-slot.approved .tlm-slot-info {
		color: #b3502c;
	}
	.tlm-slot.pending {
		background: var(--pending-tint);
	}
	.tlm-slot.pending .tlm-slot-info {
		color: #8a5a00;
	}
	.tlm-slot.past {
		background: var(--past-tint);
		cursor: not-allowed;
	}
	.tlm-slot.past .tlm-slot-info {
		color: var(--muted);
	}
}

.hint {
	font-size: 12.5px;
	color: var(--muted);
	margin: 0;
}

/* MODAL */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(22, 27, 51, 0.45);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 50;
}
.modal-overlay.open {
	display: flex;
}
.modal {
	background: var(--surface);
	border-radius: var(--radius-lg);
	width: 100%;
	max-width: 440px;
	max-height: 92vh;
	overflow-y: auto;
	box-shadow: 0 24px 60px rgba(22, 27, 51, 0.25);
}
.modal-sm {
	max-width: 400px;
}
.modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 22px 14px;
	border-bottom: 1px solid var(--border);
}
.modal-head h2 {
	font-family: var(--font-display);
	font-size: 18px;
	margin: 0;
	color: var(--navy);
}
.modal-close {
	background: none;
	border: none;
	color: var(--muted);
	cursor: pointer;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.modal-close:hover {
	background: var(--past-tint);
	color: var(--navy);
}

.modal-body {
	padding: 18px 22px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--navy);
	margin-bottom: 7px;
}
.input-icon {
	display: flex;
	align-items: center;
	gap: 9px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 9px 12px;
	background: #fbfbfe;
}
.input-icon svg {
	color: var(--muted);
	flex-shrink: 0;
}
.input-icon input {
	border: none;
	outline: none;
	background: transparent;
	font-size: 14px;
	width: 100%;
	color: var(--text);
	font-family: var(--font-body);
}
textarea {
	width: 100%;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 10px 12px;
	font-family: var(--font-body);
	font-size: 14px;
	resize: vertical;
	background: #fbfbfe;
	color: var(--text);
}
textarea:focus,
.input-icon:focus-within {
	outline: 2px solid var(--brand);
	outline-offset: 1px;
}

.room-select {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.room-pill {
	border: 1.5px solid var(--border);
	border-radius: 100px;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 600;
	color: var(--navy);
	cursor: pointer;
	background: var(--surface);
}
.room-pill.selected {
	background: var(--brand);
	border-color: var(--brand);
	color: #fff;
}
.room-pill:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 2px;
}

.slot-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.slot-chip {
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 10px;
	text-align: center;
	font-family: var(--font-mono);
	font-size: 13px;
	cursor: pointer;
	color: var(--text);
	background: var(--surface);
}
.slot-chip.selected {
	background: var(--brand-tint);
	border-color: var(--brand);
	color: var(--brand-dark);
	font-weight: 600;
}
.slot-chip.disabled {
	background: var(--past-tint);
	color: var(--past);
	cursor: not-allowed;
	text-decoration: line-through;
}
.slot-chip:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 2px;
}

.modal-error {
	font-size: 12.5px;
	color: var(--booked);
	min-height: 16px;
}

.modal-foot {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 16px 22px;
	border-top: 1px solid var(--border);
}
.btn-primary {
	background: var(--brand);
	color: #fff;
	border: none;
	font-weight: 600;
	font-size: 14px;
	padding: 11px 20px;
	border-radius: var(--radius-sm);
	cursor: pointer;
}
.btn-primary:hover {
	background: var(--brand-dark);
}
.btn-secondary {
	background: var(--surface);
	color: var(--muted);
	border: 1px solid var(--border);
	font-weight: 600;
	font-size: 14px;
	padding: 11px 18px;
	border-radius: var(--radius-sm);
	cursor: pointer;
}
.btn-secondary:hover {
	background: var(--past-tint);
	color: var(--navy);
}

#detailBody {
	font-size: 14px;
	line-height: 1.7;
}
#detailBody b {
	color: var(--navy);
}

/* TOAST */
.toast {
	position: fixed;
	bottom: 26px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	background: var(--navy);
	color: #fff;
	padding: 13px 22px;
	border-radius: 100px;
	font-size: 13.5px;
	font-weight: 500;
	opacity: 0;
	pointer-events: none;
	transition:
		opacity 0.25s ease,
		transform 0.25s ease;
	z-index: 100;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	gap: 8px;
}
.toast.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* RESPONSIVE */
@media (max-width: 900px) {
	.app {
		grid-template-columns: 1fr;
	}
	.sidebar {
		position: relative;
		height: auto;
		flex-direction: row;
		align-items: center;
		padding: 16px 20px;
		gap: 20px;
		overflow-x: auto;
	}
	.brand {
		flex-shrink: 0;
	}
	.menu {
		flex-direction: row;
		gap: 6px;
	}
	.menu-label {
		display: none;
	}
	.menu-item span {
		display: none;
	}
	.menu-item.logout {
		margin-top: 0;
	}
	.main {
		padding: 24px 18px 50px;
	}
	.stats {
		grid-template-columns: 1fr;
	}
	.topbar {
		flex-direction: column;
	}
	.legend {
		margin-left: 0;
		gap: 12px;
	}
	/* The collapse/hide toggle is a desktop concept (the sidebar is a full
	   side column there). On mobile the sidebar is already a compact,
	   horizontally-scrolling top bar, so: hide the floating toggle button
	   (it would otherwise sit fixed on top of that bar and overlap it),
	   and ignore any "collapsed" preference saved from a desktop session —
	   otherwise someone who collapsed the sidebar on desktop would open
	   the site on their phone and find the entire menu missing with no
	   way to bring it back. */
	.sidebar-toggle {
		display: none;
	}
	body.sidebar-collapsed .sidebar {
		display: flex;
		padding: 16px 20px;
		opacity: 1;
		overflow-x: auto;
		pointer-events: auto;
	}
}

/* PAGE HEADER (booking/users pages) */
.page-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

/* FILTER BAR */
.filter-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}
.search-input {
	display: flex;
	align-items: center;
	gap: 8px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 9px 12px;
	background: var(--surface);
	min-width: 220px;
	flex: 1;
}
.search-input svg {
	color: var(--muted);
	flex-shrink: 0;
}
.search-input input {
	border: none;
	outline: none;
	background: transparent;
	font-size: 13.5px;
	width: 100%;
	color: var(--text);
	font-family: var(--font-body);
}
.filter-select {
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 9px 12px;
	background: var(--surface);
	font-size: 13.5px;
	color: var(--text);
	font-family: var(--font-body);
	cursor: pointer;
}

/* TABLE CARD */
.table-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	overflow: hidden;
}
.table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x pan-y;
}
table.data-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 760px;
}
table.data-table th {
	text-align: left;
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted);
	font-weight: 600;
	padding: 13px 18px;
	border-bottom: 1px solid var(--border);
	background: #fafafd;
	white-space: nowrap;
}
table.data-table td {
	padding: 14px 18px;
	font-size: 13.5px;
	color: var(--text);
	border-bottom: 1px solid var(--border);
	vertical-align: middle;
}
table.data-table tbody tr:last-child td {
	border-bottom: none;
}
table.data-table tbody tr:hover {
	background: #fbfbfe;
}

/* Below ~700px, turn each row into a labeled stacked card instead of
   relying on horizontal scrolling — a clearer, more reliably
   "responsive" pattern on phones than swiping a wide table sideways. */
@media (max-width: 700px) {
	.table-scroll {
		overflow-x: visible;
	}
	table.data-table {
		min-width: 0;
		width: 100%;
	}
	table.data-table thead {
		display: none;
	}
	table.data-table,
	table.data-table tbody {
		display: block;
	}
	table.data-table tbody tr {
		display: block;
		margin: 14px;
		border: 1px solid var(--border);
		border-radius: var(--radius-md);
		overflow: hidden;
	}
	table.data-table tbody tr:hover {
		background: var(--surface);
	}
	table.data-table td {
		display: block;
		width: auto;
		padding: 10px 16px;
		border-bottom: 1px dashed var(--border);
		white-space: normal;
	}
	table.data-table tr td:last-child {
		border-bottom: none;
	}
	table.data-table td[data-label]::before {
		content: attr(data-label);
		display: block;
		font-size: 10.5px;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var(--muted);
		margin-bottom: 5px;
	}
	table.data-table td.cell-mono {
		font-size: 13.5px;
	}
	table.data-table .row-actions {
		justify-content: flex-start;
	}
}
.cell-primary {
	font-weight: 600;
	color: var(--navy);
}
.cell-muted {
	color: var(--muted);
	font-size: 12.5px;
}
.cell-mono {
	font-family: var(--font-mono);
	font-size: 12.5px;
}

/* BADGES */
.badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 11px;
	border-radius: 100px;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}
.badge-approved {
	background: var(--available-tint);
	color: #0b7a6d;
}
.badge-pending {
	background: #fff3d6;
	color: #9a6b00;
}
.badge-rejected {
	background: var(--booked-tint);
	color: #b3502c;
}
.badge-active {
	background: var(--available-tint);
	color: #0b7a6d;
}
.badge-inactive {
	background: var(--past-tint);
	color: var(--muted);
}
.badge-role {
	background: var(--brand-tint);
	color: var(--brand-dark);
}
.badge-admin {
	background: #ede9fe;
	color: #6d28d9;
}
.badge-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

/* AVATAR */
.avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 13px;
	color: #fff;
	flex-shrink: 0;
}
.person-cell {
	display: flex;
	align-items: center;
	gap: 11px;
}
.person-name {
	font-weight: 600;
	color: var(--navy);
	font-size: 13.5px;
}
.person-sub {
	font-size: 12px;
	color: var(--muted);
}

/* ROW ACTIONS */
.row-actions {
	display: flex;
	gap: 6px;
}
.row-btn {
	width: 30px;
	height: 30px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--muted);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		background 0.15s ease,
		color 0.15s ease;
}
.row-btn:hover {
	background: var(--brand-tint);
	border-color: var(--brand);
	color: var(--brand-dark);
}
.row-btn.danger:hover {
	background: var(--booked-tint);
	border-color: var(--booked);
	color: #b3502c;
}

/* Icon + label variant (e.g. "Batalkan" in Riwayat Peminjaman), unlike the
   fixed-size icon-only .row-btn used in admin action columns. */
.row-btn-text {
	width: auto;
	height: auto;
	padding: 6px 12px;
	gap: 6px;
	font-size: 12.5px;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none;
}

/* EMPTY STATE */
.empty-state {
	padding: 60px 20px;
	text-align: center;
	color: var(--muted);
}
.empty-state svg {
	margin-bottom: 12px;
	opacity: 0.6;
}
.empty-state p {
	margin: 0;
	font-size: 13.5px;
}

/* TABLE FOOT / PAGINATION */
.table-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	font-size: 12.5px;
	color: var(--muted);
	flex-wrap: wrap;
	gap: 10px;
}
.pagination {
	display: flex;
	gap: 6px;
}
.page-btn {
	width: 30px;
	height: 30px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	background: var(--surface);
	font-size: 12.5px;
	font-weight: 600;
	color: var(--text);
	cursor: pointer;
}
.page-btn.active {
	background: var(--brand);
	border-color: var(--brand);
	color: #fff;
}
.page-btn:hover:not(.active) {
	background: var(--brand-tint);
}

/* LOGIN PAGE */
.login-page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg);
	padding: 20px;
}
.login-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	padding: 36px 34px;
	width: 100%;
	max-width: 380px;
}
.login-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 26px;
}
.login-title {
	font-family: var(--font-display);
	font-size: 20px;
	font-weight: 700;
	color: var(--navy);
	margin: 0 0 4px;
}
.login-sub {
	font-size: 13px;
	color: var(--muted);
	margin: 0 0 22px;
}
.login-alert {
	background: var(--booked-tint);
	color: #b3502c;
	font-size: 13px;
	padding: 10px 14px;
	border-radius: var(--radius-sm);
	margin-bottom: 16px;
}
.login-hint {
	font-size: 12px;
	color: var(--muted);
	margin-top: 18px;
	text-align: center;
}

/* FLASH / ALERT BANNERS */
.alert-banner {
	padding: 12px 16px;
	border-radius: var(--radius-sm);
	font-size: 13.5px;
	margin-bottom: 16px;
}
.alert-success {
	background: var(--available-tint);
	color: #0b7a6d;
}
.alert-error {
	background: var(--booked-tint);
	color: #b3502c;
}

/* PROFILE PAGE */
.profile-grid {
	display: grid;
	grid-template-columns: 300px 1fr;
	gap: 20px;
	align-items: start;
}
@media (max-width: 900px) {
	.profile-grid {
		grid-template-columns: 1fr;
	}
}

.profile-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	padding: 26px 22px;
	text-align: center;
}
.profile-avatar-lg {
	width: 76px;
	height: 76px;
	border-radius: 50%;
	margin: 0 auto 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 26px;
	color: #fff;
	background: linear-gradient(135deg, var(--brand), #7b7ef0);
}
.profile-card h3 {
	font-family: var(--font-display);
	margin: 0 0 4px;
	font-size: 18px;
	color: var(--navy);
}
.profile-card p {
	margin: 0;
	font-size: 13px;
	color: var(--muted);
}
.profile-meta {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	gap: 10px;
	text-align: left;
}
.profile-meta-row {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
}
.profile-meta-row span:first-child {
	color: var(--muted);
}
.profile-meta-row span:last-child {
	font-weight: 600;
	color: var(--navy);
}

.form-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	padding: 24px;
}
.form-card h3 {
	font-family: var(--font-display);
	margin: 0 0 18px;
	font-size: 16px;
	color: var(--navy);
}
.field-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	margin-bottom: 14px;
}
@media (max-width: 560px) {
	.field-row {
		grid-template-columns: 1fr;
	}
}
.form-divider {
	border: none;
	border-top: 1px solid var(--border);
	margin: 20px 0;
}
.form-note {
	font-size: 12px;
	color: var(--muted);
	margin: 0 0 14px;
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}
