/* Zeitfenster – Basisdesign: heller Grün-Akzent, OpenSans, mobile-first. */

@font-face {
	font-family: "Open Sans";
	src: url("/static/vendor/opensans/OpenSans-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Open Sans";
	src: url("/static/vendor/opensans/OpenSans-SemiBold.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Open Sans";
	src: url("/static/vendor/opensans/OpenSans-Bold.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

:root {
	--accent: #34d66b;
	--accent-dark: #22a34f;
	--bg: #f7f9f8;
	--surface: #ffffff;
	--text: #1c231f;
	--muted: #6b756f;
	--border: #e1e6e3;
	--danger: #e03131;
	--radius: 10px;
	font-family: "Open Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-size: 16px;
	line-height: 1.5;
}

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

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1rem;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 10;
}
.topbar .brand {
	font-weight: 700;
	color: var(--text);
	text-decoration: none;
	font-size: 1.1rem;
}
.topbar nav {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}
/* TESTING AID ONLY - remove alongside debug_switch.go */
#debug-user-switcher select { background: #fff3b0; border: 2px dashed #b45309; font-size: 0.8rem; }

.topbar .user { color: var(--muted); font-size: 0.9rem; text-decoration: none; }
.topbar .user:hover { text-decoration: underline; }

.update-flag {
	display: inline-block;
	margin-left: 0.4rem;
	color: #d97706;
	font-size: 0.7rem;
	vertical-align: middle;
	cursor: default;
}
.update-banner {
	margin: 0;
	padding: 0.5rem 1rem;
	background: #fffbeb;
	border-bottom: 1px solid #fde68a;
	color: #92400e;
	font-size: 0.9rem;
	text-align: center;
}
.update-banner a { color: inherit; font-weight: 600; }

.changelog {
	padding: 1rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	overflow-x: auto;
}

.content {
	max-width: 960px;
	margin: 0 auto;
	padding: 1.25rem 1rem 3rem;
}
.content.content-wide {
	max-width: none;
}

.center-card {
	max-width: 380px;
	margin: 3rem auto;
	padding: 2rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

h1 { font-size: 1.5rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }

.form { display: flex; flex-direction: column; gap: 0.9rem; }
.form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }
.form label.checkbox { flex-direction: row; align-items: center; gap: 0.5rem; }
.form label.checkbox input { width: auto; }

input, select, button, textarea {
	font: inherit;
}
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="time"], input[type="datetime-local"], input[type="number"], select, textarea {
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
}
input:focus, select:focus, textarea:focus {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
}

button.primary, a.button, button.button {
	background: var(--accent);
	color: #06210f;
	border: none;
	padding: 0.65rem 1.1rem;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	text-align: center;
}
button.primary:hover, a.button:hover, button.button:hover { background: var(--accent-dark); color: #fff; }

button.is-loading {
	cursor: wait;
	opacity: 0.8;
	position: relative;
	padding-left: 2.4rem;
}
button.is-loading::before {
	content: "";
	position: absolute;
	left: 0.9rem;
	top: 50%;
	width: 1rem;
	height: 1rem;
	margin-top: -0.5rem;
	border: 2px solid rgba(6, 33, 15, 0.35);
	border-top-color: #06210f;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

select[multiple] {
	min-width: 12rem;
	min-height: 4.5rem;
}

.link-button {
	background: none;
	border: none;
	color: var(--muted);
	cursor: pointer;
	text-decoration: underline;
	padding: 0;
}

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

.team-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.team-list li {
	padding: 0.6rem 0.8rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
}
.tag {
	display: inline-block;
	font-size: 0.75rem;
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0.1rem 0.5rem;
	margin-left: 0.4rem;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
	text-align: left;
	padding: 0.5rem 0.6rem;
	border-bottom: 1px solid var(--border);
	font-size: 0.9rem;
}
.table th { color: var(--muted); font-weight: 600; }

.row-form { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.row-form input[type="text"] { flex: 1; min-width: 8rem; }

.hidden { display: none !important; }

.date-clear { display: inline-flex; align-items: center; gap: 0.3rem; }
.date-clear .clear-date { font-size: 1.1rem; line-height: 1; padding: 0 0.3rem; }

.color-popover { position: relative; display: inline-block; }
.color-popover summary {
	width: 1.9rem; height: 1.9rem; border-radius: 999px; cursor: pointer;
	list-style: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}
.color-popover summary::-webkit-details-marker { display: none; }
.color-picker-popup {
	position: absolute; z-index: 20; top: calc(100% + 0.3rem); left: 0;
	display: flex; flex-wrap: wrap; gap: 0.4rem; width: 11rem;
	padding: 0.6rem; background: var(--surface); border: 1px solid var(--border);
	border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.color-picker-popup .swatch {
	width: 1.5rem; height: 1.5rem; border-radius: 999px; cursor: pointer;
	border: 2px solid transparent; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.color-picker-popup .swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.color-picker-popup .swatch:has(input:checked) { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }

.checkbox-dropdown { position: relative; display: inline-block; }
.checkbox-dropdown summary {
	cursor: pointer; list-style: none; min-width: 9rem; display: inline-block;
	padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
}
.checkbox-dropdown summary::-webkit-details-marker { display: none; }
.checkbox-dropdown-popup {
	position: absolute; z-index: 20; top: calc(100% + 0.3rem); left: 0;
	display: flex; flex-direction: column; gap: 0.35rem; min-width: 12rem; max-height: 14rem; overflow-y: auto;
	padding: 0.6rem; background: var(--surface); border: 1px solid var(--border);
	border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.checkbox-dropdown-popup label { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; white-space: nowrap; }

.schedule-grid tr.member-row.row-dimmed { opacity: 0.3; filter: grayscale(60%); }
.schedule-grid tr.member-row.row-highlighted .name-cell { box-shadow: inset 3px 0 0 0 var(--accent); }

.year-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1rem;
}
.year-month { font-size: 0.75rem; }
.year-month caption { font-weight: 600; text-align: left; margin-bottom: 0.3rem; }
.year-month td.year-day { width: 14.28%; height: 2rem; text-align: center; vertical-align: middle; padding: 0; border: 1px solid var(--border); }
.year-month td.year-day.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.year-day-num { display: block; font-size: 0.65rem; color: var(--muted); }
.year-day-label { display: block; font-weight: 600; }

.table-scroll { overflow-x: auto; margin-bottom: 1rem; }
.table-scroll .table { min-width: 480px; }

.widget-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.75rem 0 1.5rem; }
.widget-card {
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	padding: 0.9rem 1.1rem; flex: 1 1 220px; font-size: 0.9rem;
}
.widget-card ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }

.view-switch { display: inline-flex; gap: 0.3rem; margin-left: auto; }
.view-switch a { padding: 0.4rem 0.8rem; border-radius: 8px; text-decoration: none; color: var(--muted); }
.view-switch a.button { color: #06210f; }

/* Fixed-width "rail" for tag-color stripes: every row reserves the same
   space here (regardless of how many tags this member has), so names in
   different rows always start at the same x position. Absolutely
   positioned against the cell's own padding box (not flex) so the stripes
   reliably span the cell's full height regardless of table row-height
   quirks with flex-in-table-cell layouts. */
.schedule-grid .name-cell { position: relative; padding-left: calc(0.6rem + 16px); }
.tag-stripe-rail { position: absolute; left: 0; top: 0; bottom: 0; display: flex; }
.tag-stripe { display: block; width: 6px; height: 100%; }

.month-caption th { text-align: center; font-weight: 700; background: var(--bg); }
.schedule-grid th.compact { padding: 0.25rem 0.3rem; font-size: 0.75rem; }

.schedule-grid th, .schedule-grid td { text-align: center; white-space: nowrap; }
.schedule-grid tr.group-heading th { text-align: left; background: var(--bg); color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 0.8rem; }
.schedule-grid td:first-child, .schedule-grid th:first-child { text-align: left; white-space: normal; }
.cell-form { margin: 0; }
.cell-form select {
	width: 3.2rem; padding: 0.2rem;
	background: transparent; /* let the <td>'s violation/alternative color show through */
}

.member-name { font-weight: 600; color: #3a4a42; }

.schedule-grid thead tr .today { 
	border: 3px solid var(--accent);
	border-bottom-width: 0px;
}
.schedule-grid tbody tr:last-child .today {
	border: 3px solid var(--accent);
	border-top-width: 0px;
}
.schedule-grid .today {
	border-left: 3px solid var(--accent);
	border-right: 3px solid var(--accent);
}
.schedule-grid .alt-good select { backdrop-filter: brightness(1.3); }
.schedule-grid .draft::after {
	content: "";
	position: absolute;
	top: 2px; right: 2px;
	width: 6px; height: 6px;
	border-radius: 50%;
	background: #f5a623;
}
.schedule-grid td { position: relative; }

.planning-banner { background: #fff4e0; border: 1px solid #f5a623; border-radius: 4px; padding: 0.5rem 0.75rem; }
.inline-form { display: inline-block; margin: 0; }

@media (max-width: 600px) {
	.content { padding: 1rem 0.75rem 2rem; }
	.center-card { margin: 1.5rem auto; padding: 1.25rem; }
}
