@font-face {
	font-family: "Pretendard-Regular";
	src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Regular.woff")
		format("woff");
	font-weight: 400;
	font-style: normal;
}

:root {
	/* Cozy Warm Butter-Cream & Soft Oat Palette (Eye-friendly, Low Glare) */
	--yellow-50: #FAF8F2;    /* Cozy warm ivory base - prevents monitor glare */
	--yellow-100: #F5EEDB;   /* Gentle warm cream - card highlight / subtle tint */
	--yellow-200: #EFE4C6;   /* Soft warm butter-oat - secondary active / hover */
	--yellow-300: #E2D2A4;   /* Warm muted honey-cream - primary yellow / buttons */
	--yellow-400: #D1BE89;   /* Warm biscuit tone - border & focus highlights */
	
	/* Warm Caramel & Mocha Accents (Harmonious Contrast) */
	--amber-600: #9E743F;    /* Soft warm caramel accent */
	--amber-700: #855F2F;    /* Warm bronze */
	--amber-800: #6B4A21;    /* Deep warm mocha */
	--amber-900: #4A3419;    /* Rich coffee text & dark accents */

	/* Eye-Friendly Warm Text Colors (Avoids harsh cold black/grey) */
	--text-primary: #2C2621;   /* Warm dark charcoal/espresso */
	--text-secondary: #5A524A; /* Warm medium stone */
	--text-muted: #857A70;     /* Warm muted grey */

	/* Soft Cozy Glassmorphic Card Properties */
	--card-bg: rgba(255, 254, 250, 0.92);
	--card-border: rgba(226, 210, 164, 0.6);
	--card-shadow: 0 8px 24px -4px rgba(74, 52, 25, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
	--card-shadow-hover: 0 14px 28px -4px rgba(74, 52, 25, 0.09);

	/* Status Colors (Harmonious Calming Pastels) */
	--status-ontime-bg: #EAF4EC;
	--status-ontime-text: #2D5837;
	--status-ontime-border: #BCE3C5;

	--status-late-bg: #FCF5DF;
	--status-late-text: #78521A;
	--status-late-border: #E8D39E;

	--status-online-bg: #EBF3F8;
	--status-online-text: #1B587A;
	--status-online-border: #BCD8EC;

	--status-absent-bg: #FBEAEA;
	--status-absent-text: #8E3434;
	--status-absent-border: #F3C4C4;
}

* {
	font-family: "Pretendard-Regular", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	width: 100%;
	min-height: 100vh;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	color: var(--text-primary);
	line-height: 1.5;
	background-color: var(--yellow-50);
	/* Cozy Ambient Gradient Mesh Background */
	background-image: 
		radial-gradient(at 0% 0%, rgba(239, 228, 198, 0.5) 0px, transparent 52%),
		radial-gradient(at 100% 0%, rgba(245, 238, 219, 0.45) 0px, transparent 48%),
		radial-gradient(at 50% 45%, rgba(247, 241, 227, 0.55) 0px, transparent 58%),
		radial-gradient(at 0% 100%, rgba(243, 233, 210, 0.45) 0px, transparent 52%),
		radial-gradient(at 100% 100%, rgba(239, 228, 198, 0.4) 0px, transparent 48%);
	background-attachment: fixed;
	background-size: cover;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.app-header {
	width: 100%;
	background: rgba(255, 254, 250, 0.88);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--card-border);
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 4px 16px -2px rgba(74, 52, 25, 0.04);
}

.header-inner {
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
	padding: 12px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.brand-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
}

.brand-badge {
	background: linear-gradient(135deg, var(--yellow-200) 0%, var(--yellow-300) 100%);
	color: var(--amber-900);
	font-weight: 800;
	font-size: 1.05rem;
	padding: 6px 14px;
	border-radius: 9999px;
	border: 1px solid var(--yellow-400);
	box-shadow: 0 2px 8px rgba(110, 80, 35, 0.12);
	letter-spacing: -0.02em;
}

.brand-sub {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--amber-700);
	letter-spacing: 0.05em;
}

.nav-user-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.user-greeting {
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--text-secondary);
}

.btn-logout, .btn-login {
	text-decoration: none;
	font-size: 0.88rem;
	font-weight: 600;
	padding: 6px 14px;
	border-radius: 9999px;
	transition: all 0.2s ease;
	min-height: 36px;
	display: inline-flex;
	align-items: center;
}

.btn-logout {
	color: var(--text-secondary);
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(209, 213, 219, 0.8);
}

.btn-logout:hover {
	background: #f3f4f6;
	color: var(--text-primary);
}

.btn-login {
	background: linear-gradient(135deg, var(--yellow-200) 0%, var(--yellow-300) 100%);
	color: var(--amber-900);
	border: 1px solid var(--yellow-400);
}

.btn-login:hover {
	background: var(--yellow-300);
}

/* Fallback for legacy nav tag if rendered */
nav:not(.nav-user-actions):not(.attendance-subnav) {
	width: 100%;
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(14px);
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 1em;
	padding: 0.9em 1.5em;
	border-bottom: 1px solid var(--card-border);
}

nav:not(.nav-user-actions) a {
	text-decoration: none;
	color: var(--amber-900);
	font-weight: 600;
	font-size: 0.95rem;
	padding: 6px 14px;
	border-radius: 9999px;
	background: var(--yellow-100);
	border: 1px solid var(--yellow-300);
	transition: all 0.2s;
}

nav:not(.nav-user-actions) a:hover {
	background: var(--yellow-200);
}

/* Page Container */
.page-container {
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.page-title {
	width: 100%;
	max-width: 800px;
	background: var(--card-bg);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border: 1px solid var(--card-border);
	box-shadow: var(--card-shadow);
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 1.65rem;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0 0 1.25em 0;
	padding: 0.8em 1.2em;
	border-radius: 18px;
	text-align: center;
}

/* ==========================================================================
   Sub-navigation (Attendance Menu Tabs)
   ========================================================================== */

.nav {
	width: 100%;
	max-width: 520px;
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	margin-bottom: 2em;
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(14px);
	border: 1px solid var(--card-border);
	border-radius: 9999px;
	padding: 6px;
	gap: 6px;
	box-shadow: var(--card-shadow);
}

.nav .nav-item {
	flex: 1;
	padding: 0;
	margin: 0;
	text-align: center;
	border: none;
}

.nav .nav-item a {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 14px;
	text-decoration: none;
	color: var(--text-secondary);
	font-size: 0.95rem;
	font-weight: 600;
	border-radius: 9999px;
	transition: all 0.2s ease;
}

.nav .nav-item a:hover {
	background: var(--yellow-100);
	color: var(--amber-900);
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */

form {
	width: 100%;
	max-width: 640px;
	background: var(--card-bg);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border: 1px solid var(--card-border);
	border-radius: 20px;
	padding: 2.2em 1.8em;
	margin-bottom: 2em;
	box-shadow: var(--card-shadow);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

.date-row {
	width: 100%;
	max-width: 480px;
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	gap: 12px;
	margin: 0 0 1.75em 0;
}

.date-row label {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-primary);
	white-space: nowrap;
	margin: 0;
}

input[type="date"] {
	flex: 1;
	max-width: 260px;
	min-height: 46px;
	border: 1.5px solid var(--card-border);
	background: #ffffff;
	border-radius: 12px;
	padding: 8px 14px;
	font-size: 16px; /* Prevents auto-zoom on iOS */
	font-weight: 500;
	color: var(--text-primary);
	outline: none;
	transition: all 0.2s ease;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

input[type="date"]:focus {
	border-color: var(--yellow-400);
	box-shadow: 0 0 0 3px rgba(226, 210, 164, 0.45);
}

.row {
	width: 100%;
	max-width: 520px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	margin-bottom: 1.25em;
}

.row-row {
	width: 100%;
	max-width: 520px;
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	gap: 12px;
	margin-bottom: 1.25em;
}

.row > label {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 6px;
	align-self: flex-start;
}

.row > input[type="text"],
.row > input[type="number"],
.row > input[type="password"] {
	width: 100%;
	min-height: 46px;
	border: 1.5px solid var(--card-border);
	background: #ffffff;
	border-radius: 12px;
	padding: 10px 14px;
	font-size: 16px;
	font-weight: 400;
	color: var(--text-primary);
	outline: none;
	margin: 0;
	transition: all 0.2s ease;
}

.row > input:focus {
	border-color: var(--yellow-400);
	box-shadow: 0 0 0 3px rgba(226, 210, 164, 0.45);
}

.row h3 {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0.75em 0 0.5em 0;
	text-align: center;
}

.row h4 {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-secondary);
	margin: 0.5em 0;
	text-align: center;
}

textarea {
	width: 100%;
	min-height: 120px;
	resize: vertical;
	border: 1.5px solid var(--card-border);
	background: #ffffff;
	border-radius: 12px;
	padding: 12px 14px;
	font-size: 16px;
	font-weight: 400;
	color: var(--text-primary);
	margin-bottom: 1em;
	outline: none;
	transition: all 0.2s ease;
}

textarea:focus {
	border-color: var(--yellow-400);
	box-shadow: 0 0 0 3px rgba(226, 210, 164, 0.45);
}

/* ==========================================================================
   Segmented Radio Group (Attendance Status Selector)
   ========================================================================== */

.radio_div {
	width: 100%;
	max-width: 480px;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin: 0 0 1.5em 0;
}

.radio_row {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 16px;
	min-height: 44px;
	border-radius: 9999px;
	background: rgba(255, 255, 255, 0.92);
	border: 1.5px solid var(--card-border);
	cursor: pointer;
	transition: all 0.2s ease;
	user-select: none;
}

.radio_row label {
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--text-primary);
	margin: 0;
}

.radio_row input[type="radio"] {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--amber-600);
	cursor: pointer;
}

.radio_row:has(input:checked) {
	background: var(--yellow-200);
	border-color: var(--yellow-400);
	color: var(--amber-900);
	box-shadow: 0 3px 10px rgba(110, 80, 35, 0.12);
}

.radio_row:has(input:checked) label {
	color: var(--amber-900);
	font-weight: 700;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

input[type="submit"],
.btn,
.btn-primary,
button[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 10px 24px;
	border: 1px solid var(--yellow-400);
	border-radius: 12px;
	background: linear-gradient(135deg, var(--yellow-200) 0%, var(--yellow-300) 100%);
	color: var(--amber-900);
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	box-shadow: 0 3px 10px rgba(110, 80, 35, 0.14);
	transition: all 0.2s ease;
}

input[type="submit"]:hover,
.btn:hover,
.btn-primary:hover,
button[type="submit"]:hover {
	background: linear-gradient(135deg, var(--yellow-300) 0%, var(--yellow-400) 100%);
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(110, 80, 35, 0.2);
}

input[type="submit"]:active,
.btn:active,
.btn-primary:active,
button[type="submit"]:active {
	transform: translateY(1px);
}

.btn-secondary {
	background: #f3f4f6;
	color: #374151;
	border: 1px solid #d1d5db;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
	background: #e5e7eb;
	color: #1f2937;
}

.btn-add {
	background: #dcfce7;
	color: #166534;
	border-color: #86efac;
}

.btn-add:hover {
	background: #bbf7d0;
	color: #14532d;
}

.btn-update {
	background: var(--yellow-100);
	color: var(--amber-900);
	border-color: var(--yellow-300);
}

.btn-update:hover {
	background: var(--yellow-200);
}

.btn-edit {
	background: #e0f2fe;
	color: #0369a1;
	border-color: #7dd3fc;
}

.btn-edit:hover {
	background: #bae6fd;
}

/* ==========================================================================
   Attendance Tables & Status Badges
   ========================================================================== */

#today_attendance_students,
#today_attendance_teachers {
	width: 100%;
	max-width: 1040px;
	background: var(--card-bg);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border: 1px solid var(--card-border);
	border-radius: 20px;
	padding: 24px;
	margin-bottom: 24px;
	box-shadow: var(--card-shadow);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

table {
	border-collapse: separate;
	border-spacing: 6px;
	margin-bottom: 1.25em;
	width: 100%;
	max-width: 100%;
}

td {
	min-width: 58px;
	height: 44px;
	font-size: 0.95rem;
	font-weight: 600;
	padding: 8px 10px;
	text-align: center;
	border-radius: 10px;
	border: 1px solid transparent;
	transition: all 0.18s ease;
	vertical-align: middle;
}

td:hover {
	cursor: pointer;
	transform: scale(1.06);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Distinct, Harmonious Pastel Status Classes */
.attendance-status-ontime {
	background-color: var(--status-ontime-bg) !important;
	color: var(--status-ontime-text) !important;
	border: 1px solid var(--status-ontime-border) !important;
}

.attendance-status-late {
	background-color: var(--status-late-bg) !important;
	color: var(--status-late-text) !important;
	border: 1px solid var(--status-late-border) !important;
}

.attendance-status-online {
	background-color: var(--status-online-bg) !important;
	color: var(--status-online-text) !important;
	border: 1px solid var(--status-online-border) !important;
}

.attendance-status-absent {
	background-color: var(--status-absent-bg) !important;
	color: var(--status-absent-text) !important;
	border: 1px solid var(--status-absent-border) !important;
}

#attendance_student_table tr td:first-child {
	min-width: 80px;
	background: rgba(239, 228, 198, 0.45);
	color: var(--amber-900);
	font-weight: 700;
	border: 1px solid var(--card-border);
}

/* Counter Badges */
#attendance_students_grade_count,
#attendance_students_total_count,
#attendance_teachers_count {
	background: rgba(245, 238, 219, 0.85);
	border: 1px solid var(--yellow-300);
	color: var(--amber-900);
	padding: 10px 18px;
	border-radius: 12px;
	font-size: 0.95rem;
	font-weight: 600;
	margin: 6px 0;
	display: inline-block;
	text-align: center;
}

/* ==========================================================================
   Worship Data / Jubo Presentation Table
   ========================================================================== */

.worship-data__container {
	width: 100%;
	max-width: 840px;
	margin: 1.5em auto;
	background: var(--card-bg);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border: 1px solid var(--card-border);
	border-radius: 20px;
	padding: 24px;
	box-shadow: var(--card-shadow);
	display: flex;
	flex-direction: column;
	align-items: center;
}

.worship-data__title {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--text-primary);
	margin-bottom: 20px;
	text-align: center;
}

.worship-data__table {
	width: 100%;
	border-collapse: collapse;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.worship-data__table td {
	border: 1px solid var(--card-border);
	padding: 12px 14px;
	text-align: center;
	height: auto;
	border-radius: 0;
}

.worship-data__table td:hover {
	transform: none;
	box-shadow: none;
	cursor: default;
}

.worship-data__table__category {
	background-color: var(--yellow-100);
	color: var(--amber-900);
	font-weight: 700;
	min-width: 5em;
}

.worship-data__table__context {
	background-color: #ffffff;
	color: var(--text-primary);
	min-width: 10em;
}

.page-title-list {
	width: 100%;
	max-width: 600px;
}

.page-title-list ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.page-title-list a {
	text-decoration: none;
	display: block;
}

.page-title-list li {
	background: var(--card-bg);
	backdrop-filter: blur(14px);
	border: 1px solid var(--card-border);
	border-radius: 14px;
	padding: 16px 20px;
	color: var(--text-primary);
	font-weight: 600;
	font-size: 1rem;
	box-shadow: var(--card-shadow);
	transition: all 0.2s ease;
}

.page-title-list li:hover {
	background: var(--yellow-50);
	border-color: var(--yellow-400);
	color: var(--amber-900);
	transform: translateX(4px);
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */

.alert {
	width: 100%;
	max-width: 640px;
	padding: 12px 16px;
	border-radius: 12px;
	margin-bottom: 16px;
	font-weight: 600;
	font-size: 0.95rem;
	display: flex;
	align-items: center;
	gap: 8px;
}

.alert-success {
	background-color: #dcfce7;
	color: #166534;
	border: 1px solid #86efac;
}

.alert-error {
	background-color: #fee2e2;
	color: #991b1b;
	border: 1px solid #fca5a5;
}

.alert-warning {
	background-color: var(--yellow-100);
	color: var(--amber-900);
	border: 1px solid var(--yellow-300);
}

.alert-info {
	background-color: #e0f2fe;
	color: #075985;
	border: 1px solid #7dd3fc;
}

/* ==========================================================================
   Auth Card (Login Page)
   ========================================================================== */

.auth-card-container {
	width: 100%;
	max-width: 440px;
	margin: 40px auto;
	padding: 0 16px;
}

.auth-card {
	background: var(--card-bg);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid var(--card-border);
	border-radius: 24px;
	padding: 36px 28px;
	box-shadow: var(--card-shadow);
	display: flex;
	flex-direction: column;
	align-items: center;
}

.auth-header {
	text-align: center;
	margin-bottom: 24px;
}

.auth-badge {
	display: inline-block;
	background: var(--yellow-200);
	color: var(--amber-900);
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	padding: 4px 12px;
	border-radius: 9999px;
	border: 1px solid var(--yellow-300);
	margin-bottom: 10px;
}

.auth-title {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0 0 6px 0;
}

.auth-subtitle {
	font-size: 0.9rem;
	color: var(--text-muted);
	margin: 0;
}

.auth-form {
	width: 100%;
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	box-shadow: none;
}

.auth-field-group {
	width: 100%;
	margin-bottom: 18px;
}

.auth-label {
	display: block;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 6px;
}

.auth-input {
	width: 100%;
	min-height: 48px;
	border: 1.5px solid var(--card-border);
	background: #ffffff;
	border-radius: 12px;
	padding: 10px 14px;
	font-size: 16px;
	outline: none;
	transition: all 0.2s ease;
}

.auth-input:focus {
	border-color: var(--yellow-400);
	box-shadow: 0 0 0 3px rgba(226, 210, 164, 0.45);
}

.auth-submit-btn {
	width: 100%;
	min-height: 48px;
	margin-top: 10px;
	font-size: 1.05rem;
}

/* ==========================================================================
   Responsive Mobile Adjustments
   ========================================================================== */

@media screen and (max-width: 768px) {
	.header-inner {
		padding: 10px 14px;
	}

	.brand-badge {
		font-size: 0.95rem;
		padding: 5px 10px;
	}

	.page-container {
		padding: 14px 10px;
	}

	.page-title {
		font-size: 1.35rem;
		padding: 0.6em 0.8em;
		border-radius: 14px;
	}

	.nav {
		width: 100%;
		border-radius: 14px;
		flex-direction: row;
		padding: 4px;
	}

	.nav .nav-item a {
		padding: 6px 10px;
		font-size: 0.88rem;
		min-height: 40px;
	}

	form {
		width: 100%;
		padding: 1.5em 1em;
		border-radius: 16px;
	}

	.date-row {
		flex-direction: column;
		gap: 6px;
	}

	input[type="date"] {
		width: 100%;
		max-width: 100%;
	}

	.row-row {
		flex-direction: column;
		gap: 8px;
	}

	.radio_div {
		gap: 6px;
	}

	.radio_row {
		flex: 1 1 45%;
		padding: 8px 12px;
	}

	td {
		min-width: 50px;
		height: 40px;
		font-size: 0.88rem;
		padding: 6px 4px;
	}

	#today_attendance_students,
	#today_attendance_teachers {
		padding: 14px 10px;
		border-radius: 16px;
	}

	.worship-data__container {
		padding: 16px 10px;
		border-radius: 16px;
	}
}
