/**
 * SekolahLMS - Google Design System
 * Inspired by Google Classroom, Material Design 3 (M3) & Google Workspace
 */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Google+Sans:wght@400;500;700&display=swap');

:root {
	/* Google Material Palette */
	--g-blue: #1a73e8;
	--g-blue-hover: #1557b0;
	--g-blue-surface: #e8f0fe;
	--g-blue-dark: #0b57d0;

	--g-green: #1e8e3e;
	--g-green-hover: #137333;
	--g-green-surface: #e6f4ea;

	--g-yellow: #f9ab00;
	--g-yellow-surface: #fef7e0;
	--g-yellow-dark: #e37400;

	--g-red: #d93025;
	--g-red-surface: #fce8e6;

	--g-purple: #9334e6;
	--g-purple-surface: #f3e8fd;

	--g-teal: #129eaf;
	--g-teal-surface: #e4f7fb;

	/* Neutral / Surfaces */
	--g-bg: #f8fafd;
	--g-surface: #ffffff;
	--g-surface-variant: #f1f3f4;
	--g-border: #dadce0;
	--g-border-subtle: #e8eaed;

	/* Typography Colors */
	--g-text: #202124;
	--g-text-secondary: #5f6368;
	--g-text-disabled: #80868b;

	/* Elevations */
	--g-shadow-1: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
	--g-shadow-2: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
	--g-shadow-hover: 0 2px 6px 0 rgba(60,64,67,.2), 0 6px 12px 2px rgba(60,64,67,.15);

	/* Fonts */
	--g-font-family: "Google Sans", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	--g-font-mono: "Roboto Mono", ui-monospace, "SF Mono", monospace;
	--g-max-width: 1120px;
}

/* Base Reset */
html {
	box-sizing: border-box;
}
*, *:before, *:after {
	box-sizing: inherit;
}
body, body.sekolahlms-page-active {
	margin: 0;
	padding: 0;
	background: var(--g-bg);
	color: var(--g-text);
	font-family: var(--g-font-family);
	font-size: 14px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* Google Workspace Top App Bar */
.g-appbar {
	background: var(--g-surface);
	border-bottom: 1px solid var(--g-border);
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 1px 2px rgba(60,64,67,.08);
}
.g-appbar-inner {
	max-width: var(--g-max-width);
	margin: 0 auto;
	padding: 0 20px;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.g-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: var(--g-text);
}
.g-brand-emblem {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: linear-gradient(135deg, #1a73e8 0%, #1e8e3e 100%);
	color: #ffffff;
	font-weight: 700;
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.g-brand-text {
	display: flex;
	flex-direction: column;
}
.g-brand-title {
	font-size: 18px;
	font-weight: 500;
	letter-spacing: -0.01em;
	color: var(--g-text);
	line-height: 1.2;
}
.g-brand-badge {
	font-size: 11px;
	color: var(--g-blue);
	font-weight: 500;
	letter-spacing: 0.02em;
}

/* Google Classroom Navigation Tabs */
.g-appbar-nav {
	display: flex;
	align-items: center;
	gap: 8px;
}
.g-nav-tab {
	display: inline-flex;
	align-items: center;
	padding: 10px 18px;
	color: var(--g-text-secondary);
	text-decoration: none;
	font-weight: 500;
	font-size: 14px;
	border-radius: 20px;
	transition: all 0.15s ease;
}
.g-nav-tab:hover {
	background: var(--g-surface-variant);
	color: var(--g-text);
}
.g-nav-tab.is-active {
	background: var(--g-blue-surface);
	color: var(--g-blue);
	font-weight: 600;
}

/* App Bar Actions & Avatar */
.g-appbar-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}
.g-user-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	padding: 4px 12px 4px 6px;
	background: var(--g-surface-variant);
	border: 1px solid var(--g-border);
	border-radius: 24px;
	color: var(--g-text);
	font-size: 13px;
	font-weight: 500;
}
.g-user-avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--g-blue);
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}
.g-logout-link {
	color: var(--g-red);
	font-size: 13px;
	text-decoration: none;
	font-weight: 500;
	padding: 6px 10px;
	border-radius: 4px;
}
.g-logout-link:hover {
	background: var(--g-red-surface);
}

/* Main Container */
.g-container {
	max-width: var(--g-max-width);
	margin: 0 auto;
	padding: 32px 20px 64px;
}

/* Material 3 Buttons */
.g-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 24px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	border-radius: 24px;
	border: 1px solid transparent;
	text-decoration: none;
	cursor: pointer;
	line-height: 1.25;
	transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}
.g-btn:active {
	transform: scale(0.98);
}
.g-btn-filled {
	background: var(--g-blue);
	color: #ffffff;
	box-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
}
.g-btn-filled:hover {
	background: var(--g-blue-hover);
	color: #ffffff;
	box-shadow: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
}
.g-btn-outlined {
	background: var(--g-surface);
	color: var(--g-blue);
	border: 1px solid var(--g-border);
}
.g-btn-outlined:hover {
	background: var(--g-blue-surface);
	border-color: var(--g-blue);
}
.g-btn-tonal {
	background: var(--g-blue-surface);
	color: var(--g-blue);
}
.g-btn-tonal:hover {
	background: #d2e3fc;
}
.g-btn-sm {
	padding: 6px 16px;
	font-size: 13px;
	border-radius: 18px;
}
.g-btn-block {
	width: 100%;
}

/* Material Chips & Badges */
.g-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 12px;
	border-radius: 16px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.3;
}
.g-chip-blue   { background: var(--g-blue-surface); color: var(--g-blue); }
.g-chip-green  { background: var(--g-green-surface); color: var(--g-green); }
.g-chip-yellow { background: var(--g-yellow-surface); color: var(--g-yellow-dark); }
.g-chip-red    { background: var(--g-red-surface); color: var(--g-red); }
.g-chip-purple { background: var(--g-purple-surface); color: var(--g-purple); }
.g-chip-neutral{ background: var(--g-surface-variant); color: var(--g-text-secondary); }

/* Google Classroom Cards */
.g-course-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
	align-items: stretch;
}
.g-class-card {
	background: var(--g-surface);
	border: 1px solid var(--g-border);
	border-radius: 8px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	display: flex;
	flex-direction: column;
	transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
	box-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
}
.g-class-card:hover {
	box-shadow: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
	transform: translateY(-2px);
}
/* Google Classroom Colored Header Banner */
.g-class-banner {
	padding: 20px 20px 16px;
	color: #ffffff;
	position: relative;
	background: #1967d2; /* Math/Science Blue */
}
.g-class-banner.green {
	background: #137333; /* Language/Biology Green */
}
.g-class-banner.teal {
	background: #007b83; /* Social Studies Teal */
}
.g-class-banner.purple {
	background: #7627bb; /* Arts Purple */
}

.g-course-grid .g-class-card {
	height: 100%;
}
.g-class-title {
	margin: 0 0 4px 0;
	font-size: 20px;
	font-weight: 500;
	color: #ffffff;
	line-height: 1.3;
}
.g-class-section {
	font-size: 13px;
	color: rgba(255,255,255,0.9);
	margin-bottom: 2px;
}
.g-class-teacher {
	font-size: 13px;
	color: rgba(255,255,255,0.85);
}
.g-class-card-body {
	padding: 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}
.g-class-desc {
	font-size: 13px;
	color: var(--g-text-secondary);
	line-height: 1.5;
	flex: 1;
	margin: 0 0 16px 0;
}
.g-class-card-foot {
	border-top: 1px solid var(--g-border-subtle);
	padding-top: 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 13px;
}

/* Google Classroom Single Course Header */
.g-classroom-header {
	background: #1967d2;
	border-radius: 8px;
	color: #ffffff;
	padding: 36px 32px;
	margin-bottom: 24px;
	position: relative;
	box-shadow: var(--g-shadow-1);
}
.g-classroom-header.green {
	background: #137333;
}
.g-classroom-title {
	font-size: 32px;
	font-weight: 500;
	margin: 0 0 8px 0;
	color: #ffffff;
}
.g-classroom-sub {
	font-size: 16px;
	color: rgba(255,255,255,0.9);
	margin: 0 0 16px 0;
}
.g-classroom-meta-pills {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	font-size: 13px;
}
.g-classroom-pill {
	background: rgba(255,255,255,0.18);
	padding: 4px 12px;
	border-radius: 16px;
	font-weight: 500;
}

/* Google Classroom Classwork / Topics List */
.g-topic-section {
	margin-bottom: 32px;
}
.g-topic-heading {
	font-size: 20px;
	font-weight: 500;
	color: var(--g-text);
	border-bottom: 2px solid var(--g-blue);
	padding-bottom: 8px;
	margin: 0 0 16px 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.g-activity-stack {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.g-activity-card {
	background: var(--g-surface);
	border: 1px solid var(--g-border);
	border-radius: 8px;
	padding: 16px 20px;
	text-decoration: none;
	color: inherit;
	display: flex;
	align-items: center;
	gap: 16px;
	transition: all 0.15s ease;
	box-shadow: 0 1px 2px rgba(60,64,67,.08);
}
.g-activity-card:hover {
	border-color: #bdc1c6;
	background: #fcfdff;
	box-shadow: var(--g-shadow-1);
}
.g-activity-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.g-activity-avatar.lesson     { background: var(--g-blue-surface); color: var(--g-blue); }
.g-activity-avatar.assignment { background: var(--g-green-surface); color: var(--g-green); }
.g-activity-avatar.quiz       { background: var(--g-purple-surface); color: var(--g-purple); }
.g-activity-info {
	flex: 1;
	min-width: 0;
}
.g-activity-title {
	font-size: 15px;
	font-weight: 500;
	color: var(--g-text);
	margin: 0 0 2px 0;
}
.g-activity-sub {
	font-size: 12px;
	color: var(--g-text-secondary);
	margin: 0;
}
.g-activity-end {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

/* Google Forms Style Exam Player */
.g-form-card {
	background: var(--g-surface);
	border: 1px solid var(--g-border);
	border-radius: 8px;
	box-shadow: var(--g-shadow-1);
	margin-bottom: 20px;
	position: relative;
	overflow: hidden;
}
.g-form-accent-bar {
	height: 10px;
	background: #673ab7; /* Google Forms Purple */
}
.g-form-accent-bar.blue {
	background: var(--g-blue);
}
.g-form-body {
	padding: 24px 28px;
}
.g-form-title {
	font-size: 26px;
	font-weight: 500;
	margin: 0 0 8px 0;
	color: var(--g-text);
}
.g-form-desc {
	font-size: 14px;
	color: var(--g-text-secondary);
	margin: 0 0 20px 0;
	line-height: 1.6;
}

/* Material 3 Radio Options */
.g-radio-option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	border: 1px solid var(--g-border-subtle);
	border-radius: 8px;
	margin-bottom: 10px;
	cursor: pointer;
	transition: all 0.15s ease;
	background: var(--g-surface);
}
.g-radio-option:hover {
	background: var(--g-blue-surface);
	border-color: var(--g-blue);
}
.g-radio-option input[type="radio"] {
	width: 18px;
	height: 18px;
	accent-color: var(--g-blue);
	margin: 0;
}

/* Sticky Google Exam Timer Bar */
.g-timer-chip {
	position: sticky;
	top: 76px;
	z-index: 90;
	background: var(--g-blue);
	color: #ffffff;
	border-radius: 24px;
	padding: 10px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	box-shadow: var(--g-shadow-1);
}
.g-timer-number {
	font-family: var(--g-font-mono);
	font-size: 18px;
	font-weight: 700;
	color: #ffffff;
}

/* Lesson Reader / Split Screen */
.g-reader-shell {
	display: grid;
	grid-template-columns: 280px 1fr;
	min-height: calc(100vh - 64px);
}
.g-reader-aside {
	background: var(--g-surface);
	border-right: 1px solid var(--g-border);
	padding: 20px 16px;
	overflow-y: auto;
}
.g-reader-main {
	padding: 36px 40px;
	max-width: 860px;
}
.g-reader-article {
	background: var(--g-surface);
	border: 1px solid var(--g-border);
	border-radius: 8px;
	padding: 36px 40px;
	box-shadow: var(--g-shadow-1);
}

/* Google Tables & Inputs */
.g-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}
.g-table th, .g-table td {
	padding: 14px 16px;
	border-bottom: 1px solid var(--g-border);
	text-align: left;
}
.g-table th {
	background: var(--g-surface-variant);
	font-weight: 500;
	color: var(--g-text-secondary);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.g-input, .g-select, .g-textarea {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid var(--g-border);
	border-radius: 4px;
	font-family: inherit;
	font-size: 14px;
	background: var(--g-surface);
	color: var(--g-text);
	transition: border-color 0.15s;
}
/* ui-system.css memasang height:40px untuk kelas yang sama; digabung dengan
   padding 12px di atas, kotak teks tinggal 14px sehingga teks terpotong.
   Biarkan tinggi mengikuti padding (min-height menjaga tampilan tetap 40px). */
.g-input, .g-select {
	height: auto;
	min-height: 40px;
	padding-top: 8px;
	padding-bottom: 8px;
}
.g-input:focus, .g-select:focus, .g-textarea:focus {
	outline: none;
	border-color: var(--g-blue);
	box-shadow: 0 0 0 1px var(--g-blue);
}

/* Google Workspace Footer */
.g-footer,
.lms-site-footer {
	background: var(--surface);
	border-top: 1px solid var(--border);
	padding: var(--space-4) 0;
	color: var(--text-muted);
	font-size: var(--text-sm);
	margin-top: auto;
}
.g-footer-inner,
.lms-footer-inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-3);
	padding: 0 var(--space-4);
}
.lms-footer-brand strong { color: var(--text); }
.lms-footer-brand span { color: var(--text-muted); margin-left: 6px; }
.lms-footer-nav { display: flex; gap: var(--space-4); }
.lms-footer-nav a { color: var(--text-muted); text-decoration: none; }
.lms-footer-nav a:hover { color: var(--primary); }
.lms-footer-copyright { width: 100%; font-size: var(--text-xs); color: var(--text-muted); border-top: 1px solid var(--border-light); padding-top: var(--space-2); text-align: center; margin-top: var(--space-1); }

/* Mobile Responsiveness */
@media (max-width: 768px) {
	.g-appbar-inner {
		height: auto;
		padding: 12px 16px;
		display: grid;
		grid-template-columns: 1fr auto;
		gap: 10px;
	}
	.g-appbar-nav {
		grid-column: 1 / span 2;
		overflow-x: auto;
		padding-bottom: 4px;
	}
	.g-reader-shell {
		grid-template-columns: 1fr;
	}
	.g-reader-main {
		padding: 16px;
	}
	.g-reader-article {
		padding: 24px 20px;
	}
	.g-course-grid {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 1280px) {
	.g-course-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* =====================================================================
   Halaman Presensi satu pertemuan (templates/page-attendance.php)
   ===================================================================== */
.att-hero {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}
.att-title {
	font-size: 22px;
	font-weight: 500;
	color: var(--g-text);
	margin: 6px 0 2px;
	line-height: 1.3;
}
.att-sub {
	font-size: 13px;
	color: var(--g-text-secondary);
	margin: 0;
}
.att-counts {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}
.att-toolbar {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}
.att-toolbar .g-input {
	flex: 1 1 220px;
	min-width: 0;
}
.att-rows {
	display: flex;
	flex-direction: column;
}
.att-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 120px;
	gap: 12px;
	align-items: center;
	padding: 11px 0;
	border-bottom: 1px solid var(--g-border-subtle);
}
.att-row:last-child {
	border-bottom: 0;
}
.att-name {
	min-width: 0;
}
.att-name strong {
	display: block;
	font-size: 14px;
	color: var(--g-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.att-name span {
	font-size: 12px;
	color: var(--g-text-secondary);
}
.att-row .g-select {
	width: 100%;
}
.att-savebar {
	position: sticky;
	bottom: 0;
	display: flex;
	gap: 12px;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	margin-top: 16px;
	padding: 12px 0;
	background: var(--g-surface);
	border-top: 1px solid var(--g-border);
}
.att-progress {
	font-size: 12px;
	color: var(--g-text-secondary);
}

@media (max-width: 640px) {
	.att-row {
		grid-template-columns: minmax(0, 1fr) 96px;
		gap: 8px;
	}
	.att-title {
		font-size: 19px;
	}
	.att-savebar .g-btn {
		flex: 1 1 100%;
	}
}
