/* ============================================================
   Werkrooster — Excel-style full-year view
   ============================================================ */

/* Login form */
.wrk-login {
	max-width: 360px;
	margin: 3rem auto;
	padding: 2rem;
	border: 1px solid #ddd;
	border-radius: 8px;
	text-align: center;
	background: #fafafa;
}

.wrk-login h3 {
	margin-top: 0;
}

.wrk-login input[type="password"] {
	display: block;
	width: 100%;
	padding: 0.6rem 0.8rem;
	margin-bottom: 1rem;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 1rem;
	box-sizing: border-box;
}

.wrk-login button {
	display: block;
	width: 100%;
	padding: 0.6rem;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 1rem;
	cursor: pointer;
}

.wrk-login button:hover {
	background: #135e96;
}

.wrk-error {
	background: #fce4e4;
	color: #c00;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	margin-bottom: 1rem;
	font-size: 0.9rem;
}

/* ---- Container ---- */
.wrk-container {
	max-width: 100%;
	margin: 1rem 0;
}

/* ---- Month quick-jump nav ---- */
.wrk-month-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 0.75rem;
}

.wrk-month-btn {
	padding: 0.3rem 0.7rem;
	background: #f0f0f0;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.8rem;
	cursor: pointer;
	color: #333;
	line-height: 1.2;
}

.wrk-month-btn:hover {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

/* ---- Scrollable table wrapper ---- */
.wrk-table-wrap {
	overflow-x: auto;
	overflow-y: visible;
	-webkit-overflow-scrolling: touch;
	border: 1px solid #ccc;
	border-radius: 4px;
}

/* ---- Table base ---- */
.wrk-table {
	border-collapse: separate;
	border-spacing: 0;
	font-size: 0.75rem;
	table-layout: fixed;
}

.wrk-table th,
.wrk-table td {
	border-right: 1px solid #e0e0e0;
	border-bottom: 1px solid #e0e0e0;
	padding: 0.2rem 0.15rem;
	text-align: center;
	vertical-align: middle;
	box-sizing: border-box;
}

/* ---- Column sizing ---- */
.wrk-cell,
.wrk-day-header {
	width: 36px;
	min-width: 36px;
	max-width: 36px;
}

/* ---- Sticky name column ---- */
.wrk-name-col {
	text-align: left !important;
	white-space: nowrap;
	position: sticky;
	left: 0;
	z-index: 3;
	background: #fff;
	min-width: 130px;
	width: 130px;
	padding-left: 0.5rem !important;
	padding-right: 0.5rem !important;
	font-size: 0.8rem;
	border-right: 2px solid #999 !important;
}

/* ---- Sticky header rows ---- */
.wrk-table thead {
	position: sticky;
	top: 0;
	z-index: 5;
}

.wrk-corner {
	z-index: 10 !important;
	background: #f5f5f5 !important;
	color: #333 !important;
}

/* ---- Month header row ---- */
.wrk-month-row th {
	background: #2271b1;
	color: #fff;
	font-weight: 700;
	font-size: 0.85rem;
	padding: 0.35rem 0.3rem;
	border-right: 2px solid #fff;
	border-bottom: 1px solid #1a5a8e;
}

/* ---- Week number row ---- */
.wrk-week-row th {
	background: #f5f5f5;
	font-weight: 600;
	font-size: 0.7rem;
	padding: 0.2rem 0.15rem;
	color: #555;
}

.wrk-week-header {
	border-right: 2px solid #ccc !important;
}

/* ---- Day header row ---- */
.wrk-day-row th {
	background: #fafafa;
	font-weight: 400;
	padding: 0.2rem 0.1rem;
}

.wrk-day-abbr {
	display: block;
	font-weight: 600;
	font-size: 0.7rem;
	line-height: 1.1;
}

.wrk-day-date {
	display: block;
	font-size: 0.6rem;
	color: #999;
	line-height: 1.1;
}

/* ---- Week separators (every 6th column) ---- */
.wrk-cell:nth-child(6n+1) {
	/* first day of week already separated by week-header border above */
}

/* Use right border on Saturday columns to separate weeks */
td.wrk-cell:nth-of-type(6n) {
	border-right: 2px solid #ccc;
}

/* Also for day headers */
th.wrk-day-header:nth-of-type(6n) {
	border-right: 2px solid #ccc;
}

/* ---- Status colors ---- */
.wrk-working {
	background-color: #e8f5e9;
}

.wrk-off {
	background-color: #ffcdd2;
	color: #b71c1c;
}

.wrk-off-confirmed {
	background-color: #ffcdd2;
	color: #b71c1c;
	font-weight: 600;
}

.wrk-offsite {
	background-color: #f3e5f5;
	color: #6a1b9a;
}

.wrk-scheduled {
	background-color: #e8f5e9;
	color: #2e7d32;
	font-weight: 600;
}

.wrk-vacation {
	background-color: #fff9c4;
	color: #f57f17;
	font-weight: 600;
}

.wrk-early {
	background-color: #ffe0b2;
	color: #e65100;
}

.wrk-late {
	background-color: #e1bee7;
	color: #6a1b9a;
}

.wrk-home {
	background-color: #bbdefb;
	color: #0d47a1;
}

.wrk-tbd {
	background-color: #fff3cd;
	color: #856404;
}

.wrk-other {
	background-color: #f5f5f5;
	color: #555;
}

/* ---- Today highlight ---- */
.wrk-today {
	box-shadow: inset 0 0 0 2px #2271b1;
}

thead .wrk-today {
	background: #e3f2fd !important;
}

/* ---- Current week highlight ---- */
.wrk-current-week {
	background: #e3f2fd !important;
	color: #0d47a1;
	font-weight: 700;
}

.wrk-current-week-cell {
	/* subtle tint to mark the entire current week column band */
}

/* ---- Holiday column ---- */
.wrk-holiday-col {
	position: relative;
}

.wrk-holiday-dot {
	display: block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #d32f2f;
	margin: 1px auto 0;
}

thead .wrk-holiday-col {
	background: #fff3e0 !important;
}

tbody .wrk-holiday-col {
	/* add subtle stripe overlay for holidays */
	background-image: repeating-linear-gradient(
		-45deg,
		transparent,
		transparent 3px,
		rgba(0, 0, 0, 0.03) 3px,
		rgba(0, 0, 0, 0.03) 6px
	);
}

.wrk-holiday-swatch {
	background: #fff3e0 !important;
	position: relative;
}

.wrk-holiday-swatch::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #d32f2f;
	transform: translate(-50%, -50%);
}

/* ---- Staffing row ---- */
.wrk-staffing-row td {
	background-color: #f0f0f0 !important;
	font-weight: 600;
	border-top: 2px solid #bbb;
	background-image: none !important;
}

.wrk-staffing-row .wrk-name-col {
	background-color: #f0f0f0 !important;
}

/* ---- Legend ---- */
.wrk-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.8rem;
	margin-top: 0.75rem;
	font-size: 0.8rem;
	color: #555;
}

.wrk-legend-item {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.wrk-swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 1px solid #ccc;
	border-radius: 2px;
	position: relative;
	flex-shrink: 0;
}

/* ---- Zebra striping for readability ---- */
.wrk-table tbody tr:nth-child(even) .wrk-name-col {
	background-color: #f8f8f8;
}

.wrk-table tbody tr:nth-child(even) .wrk-working {
	background-color: #dcedc8;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
	.wrk-month-nav {
		gap: 2px;
	}

	.wrk-month-btn {
		padding: 0.2rem 0.4rem;
		font-size: 0.7rem;
	}

	.wrk-table {
		font-size: 0.65rem;
	}

	.wrk-cell,
	.wrk-day-header {
		width: 28px;
		min-width: 28px;
		max-width: 28px;
	}

	.wrk-name-col {
		min-width: 90px;
		width: 90px;
		font-size: 0.7rem;
	}
}
