/* =======================
Variables & Base (mobile-first)
======================= */
:root {
	--bg: #fff;
	--card: #fffbf5;
	--text: #2b2b2b;
	--muted: #6b6b6b;
	--accent: #FFB03B;
	--valid: #6BD3FF;
	--danger: #FF6B6B;
	--success: #6eb92b;
	--radius: 14px;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
	font-size: 16px;
}

* {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
}

body {
	margin: 0;
	background: linear-gradient(180deg, var(--bg), var(--card));
	color: var(--text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

/* =======================
App layout
======================= */
.app {
	flex: 1;
	display: flex;
	flex-direction: column;
	position: relative;
	padding-bottom: 88px;
	/* room for bottom nav */
	overflow: hidden;
}

header.app-header {
	padding: 14px;
	display: flex;
	align-items: center;
	gap: 12px;
	background: transparent;
	position: sticky;
	top: 0;
	z-index: 5;
	backdrop-filter: blur(6px);
}

header h1 {
	font-size: 18px;
	margin: 0;
}

main {
	padding: 12px;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* =======================
Bottom navigation
======================= */
nav.bottom-nav {
	position: fixed;
	bottom: 12px;
	left: 12px;
	right: 12px;
	height: 64px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.95));
	border-radius: 22px;
	display: flex;
	justify-content: space-around;
	align-items: center;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
	z-index: 20;
	padding: 8px 12px;
	gap: 6px;
}

.nav-item {
	flex: 1;
	text-align: center;
	font-size: 12px;
	color: var(--muted);
	cursor: pointer;
	padding: 6px;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

.nav-item.active {
	color: var(--accent);
	transform: translateY(-4px);
	transition: transform .18s
}

.nav-item svg {
	width: 22px;
	height: 22px;
	opacity: 0.95;
}

/* =======================
Child selector (floating horizontal)
======================= */
.child-selector {
	display: flex;
	gap: 10px;
	overflow: auto;
	padding: 5px;
	border-radius: 12px;
	backdrop-filter: blur(6px);
	margin-bottom: 10px;
}

.kid {
	min-width: 100px;
	padding: 5px;
	border-radius: 12px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
	display: flex;
	gap: 8px;
	align-items: center;
	cursor: pointer;
	flex-shrink: 0;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
	transition: transform .14s, box-shadow .14s;
	border: 1px solid var(--accent);
	opacity: 0.5;
}

.kid .avatar {
	width: 32px;
	height: 32px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--valid), var(--accent));
	display: flex;
	align-items: center;
	justify-content: center;
	color: #012;
}

.kid .info {
	font-size: 13px;
}

.kid .name {
	font-weight: 600;
}

.kid.small {
	min-width: 86px;
}

/* selected */
.kid[aria-pressed="true"] {
	outline: 3px solid rgba(255, 176, 59, 0.18);
	transform: translateY(-5px);
	opacity: 1;
}

/* =======================
Presence list
======================= */
.presence-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	overflow: auto;
	flex: 1;
}

.day-row {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.8));
	border-radius: 12px;
	padding: 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.04);
}

.day-left {
	display: flex;
	flex-direction: column;
}

.day-date {
	font-weight: 700;
}

.day-meta {
	font-size: 13px;
	color: var(--muted);
}

.status-pill {
	padding: 6px 10px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 13px;
}

.status-present {
	background: rgba(107, 211, 255, 0.12);
	color: var(--valid);
}

.status-absent {
	background: rgba(255, 107, 107, 0.08);
	color: var(--danger);
}

.status-sick {
	background: rgba(255, 176, 59, 0.09);
	color: var(--accent);
}

/* =======================
Tabs & panels
======================= */
.panel {
	display: none;
	flex: 1;
	flex-direction: column;
	overflow: auto;
}

.panel.active {
	display: flex;
}

.panel>* {
	flex-shrink: 0;
}

.subpanel {
	flex: 1;
	overflow: auto;
	display: flex;
	flex-direction: column;
}

/* =======================
Contact (form & chat)
======================= */
.card {
	background: var(--card);
	padding: 12px;
	border-radius: 12px;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.04);
}

.h {
	font-size: 15px;
	font-weight: 700;
	margin: 0 0 8px 0;
}

.segmented {
	display: flex;
	gap: 8px;
}

.segmented button {
	flex: 1;
	padding: 8px;
	border-radius: 10px;
	border: none;
	background: transparent;
	cursor: pointer;
}

.segmented button[aria-pressed="true"] {
	background: var(--accent);
	color: white;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

label {
	display: block;
	font-size: 13px;
	margin: 8px 0 6px 0;
}

input[type="text"],
input[type="date"],
input[type="time"],
textarea,
select {
	width: 100%;
	padding: 10px;
	border-radius: 10px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	font-size: 14px;
	background: white;
}

textarea {
	min-height: 86px;
	resize: vertical;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--accent);
	color: white;
	border: none;
	cursor: pointer;
	font-weight: 700;
}

.btn.send {
	margin-left: auto;
	font-size: smaller;
}

.btn.ghost {
	background: transparent;
	color: var(--accent);
	border: 2px solid rgba(0, 0, 0, 0.04);
}

.chat-window {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
	overflow: auto;
}

.messages {
	flex: 1;
	overflow: auto;
	padding: 8px;
	display: flex;
	flex-direction: column-reverse;
	gap: 8px;
}

.msg {
	max-width: 76%;
	padding: 10px;
	border-radius: 12px;
}

.msg.me {
	align-self: flex-end;
	background: var(--accent);
	color: white;
}

.msg.them {
	align-self: flex-start;
	background: rgba(0, 0, 0, 0.04);
	color: var(--text);
}

.compose {
	flex-shrink: 0;
	display: flex;
	gap: 8px;
	padding-top: 8px;
}

.hint {
	font-style: italic;
	font-size: 12px;
	opacity: 0.6;
	margin-bottom: 5px;
}

/* =======================
Calendar
======================= */
.calendar {
	width: 100%;
	max-width: 760px;
	margin: 0 auto;
}

.calendar>div {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
	margin-bottom: 6px;
}

.calendar>div>div {
	text-align: center;
	font-weight: 700;
}

.cal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
}

.cal-cell {
	min-height: 72px;
	padding: 8px;
	border-radius: 10px;
	background: transparent;
	display: flex;
	flex-direction: column;
	gap: 6px;
	cursor: pointer;
	align-items: flex-start;
}

.cal-cell .date-num {
	font-weight: 700;
}

.dot-row {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: auto;
}

.dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

.popup {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	bottom: 96px;
	z-index: 70;
	background: var(--card);
	border-radius: 12px;
	padding: 12px;
	box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
	max-width: 94%;
	min-width: 220px;
}

.overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.28);
	z-index: 60;
}

/* =======================
Account page elements
======================= */
.account-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.account-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px;
	border-radius: 12px;
	background: var(--card);
}

.toggle {
	width: 48px;
	height: 28px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.06);
	position: relative;
	cursor: pointer;
}

.toggle .knob {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: white;
	position: absolute;
	top: 3px;
	left: 3px;
	transition: all .18s;
}

.toggle[data-on="true"] {
	background: linear-gradient(90deg, var(--accent), var(--valid));
}

.toggle[data-on="true"] .knob {
	left: 23px;
}

/* =======================
Responsive tweaks
======================= */
@media(min-width:820px) {
	.app {
		padding-left: 72px;
		padding-right: 72px;
	}

	nav.bottom-nav {
		left: 24%;
		right: 24%;
	}
}

/* micro interactions */
button:active,
.nav-item:active {
	transform: scale(.98);
}

.fade-in {
	animation: fadeIn .28s ease;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}