@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --primary: #2563EB;
  --primary-light: #DBEAFE;
  --primary-hover: #1D4ED8;
  --accent: #FF7A3D;
  --accent-light: #FFE8DC;
  --sky: #2BB3FF;
  --mint: #34D399;
  --sun: #FFD54A;
  --grape: #7C5CFF;
  --pink: #FF6BA8;
  --bg-main: #FFF6E8;
  --bg-card: #ffffff;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --border: #F3D9B8;
  
  --success: #22C55E;
  --success-bg: #ECFDF3;
  --warning: #FBBF24;
  --warning-bg: #FFFBEB;
  --danger: #F43F5E;
  --danger-bg: #FFF1F2;
  
  --font-family: 'Nunito', 'Fredoka', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: 'Fredoka', 'Nunito', sans-serif;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 4px 0 rgba(37, 99, 235, 0.08);
  --shadow-md: 0 10px 0 rgba(255, 122, 61, 0.12);
  --shadow-lg: 0 18px 40px rgba(43, 179, 255, 0.22);
  --transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(43, 179, 255, 0.18) 0 120px, transparent 121px),
    radial-gradient(circle at 88% 8%, rgba(255, 213, 74, 0.35) 0 90px, transparent 91px),
    radial-gradient(circle at 92% 78%, rgba(255, 107, 168, 0.16) 0 140px, transparent 141px),
    radial-gradient(circle at 8% 86%, rgba(124, 92, 255, 0.12) 0 110px, transparent 111px);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}

img, canvas, video, svg, table, select, input, textarea {
  max-width: 100%;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, #FFD54A 0 18%, transparent 19%),
    radial-gradient(circle at 80% 10%, #2BB3FF 0 16%, transparent 17%),
    radial-gradient(circle at 85% 80%, #FF6BA8 0 14%, transparent 15%),
    linear-gradient(165deg, #7C5CFF 0%, #2BB3FF 48%, #34D399 100%);
}
.login-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 32px;
  padding: 32px 28px 24px;
  box-shadow: 0 16px 0 #1D4ED8, 0 28px 50px rgba(15, 23, 42, 0.2);
  position: relative;
  overflow: hidden;
  border: 4px solid #fff;
}
.login-blob {
  position: absolute;
  top: -40px;
  right: -30px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, #FFD54A, transparent 70%);
  pointer-events: none;
}
.login-logo {
  width: 78px;
  height: 78px;
  display: block;
  margin: 0 auto 10px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 6px;
  border: 4px solid #FFD54A;
  position: relative;
  z-index: 1;
}
.login-kicker {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.login-card h1 {
  text-align: center;
  font-family: var(--font-display);
  font-size: 26px;
  color: #1E3A8A;
  margin: 4px 0 6px;
}
.login-school, .login-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.login-hint { margin-bottom: 16px; }
.role-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.role-chip {
  border: 3px solid #F3D9B8;
  background: #FFFDF8;
  border-radius: 16px;
  padding: 12px 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.role-chip span { font-size: 22px; }
.role-chip.active {
  border-color: #2BB3FF;
  background: linear-gradient(180deg, #E0F4FF, #fff);
  color: #1D4ED8;
  transform: translateY(-3px);
  box-shadow: 0 6px 0 #2BB3FF;
}
.btn-google {
  width: 100%;
  justify-content: center;
  background: #fff;
  color: #1f2937;
  border: 2px solid #e5e7eb;
  border-radius: 999px;
  box-shadow: 0 4px 0 #cbd5e1;
  margin: 8px 0 4px;
  font-weight: 700;
}
.btn-google:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #cbd5e1;
}
.btn-google-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.login-or {
  margin: 18px 0 14px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: lowercase;
}
#login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#login-form .btn-primary {
  margin-top: 8px;
}
.login-error {
  color: var(--danger);
  font-size: 13px;
  margin: 0;
}
.login-demo {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.login-demo ul { margin: 8px 0 0 16px; }
.login-demo code { font-size: 11px; }

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.user-chip-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-chip {
  font-size: 12px;
  background: rgba(255,255,255,0.12);
  padding: 6px 12px;
  border-radius: 999px;
}
.btn-logout {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.feedback-list-card, .feedback-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}
.quote-banner {
  background: linear-gradient(120deg, #ECFDF5, #FEF9C3 55%, #E0F2FE);
  border: 3px solid #fff;
  border-radius: 24px;
  padding: 18px 22px 16px;
  margin-bottom: 22px;
  box-shadow: 0 8px 0 rgba(16, 185, 129, 0.18);
}
.quote-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #059669;
  margin-bottom: 6px;
}
.quote-banner blockquote {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.45;
  color: #14532D;
  margin: 0;
}
.quote-banner cite {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  color: #B45309;
}
.readonly-note, .readonly-empty {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.feedback-time {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #2563EB;
  margin: 4px 0 8px;
}
.feedback-item-readonly {
  background: #F8FAFF;
  border: 2px solid #BFDBFE;
}
.student-feedback-card {
  margin-bottom: 22px;
}
.feedback-target { font-weight: 600; margin: 4px 0; }
#feedback-message, #report-notes {
  width: 100%;
  font-family: var(--font-family);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.login-screen[hidden],
#app-shell[hidden] {
  display: none !important;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
}

/* Header & Navigation */
header {
  background: linear-gradient(120deg, #2BB3FF 0%, #7C5CFF 48%, #FF7A3D 100%);
  color: white;
  padding: 24px 5%;
  box-shadow: 0 8px 0 rgba(29, 78, 216, 0.2);
  position: relative;
  overflow: hidden;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
}

header::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -8%;
  width: 280px;
  height: 280px;
  background: rgba(255, 213, 74, 0.28);
  border-radius: 50%;
  pointer-events: none;
}
header::after {
  content: '';
  position: absolute;
  bottom: -50px;
  left: 12%;
  width: 160px;
  height: 160px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 40px;
  transform: rotate(18deg);
  pointer-events: none;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.school-branding {
  display: flex;
  align-items: center;
  gap: 16px;
}

.school-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.school-logo img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 50%;
  padding: 4px;
  box-shadow: 0 6px 0 #FFD54A;
  border: 3px solid #fff;
}

.school-title h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-family: var(--font-display);
}

.school-title p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
}

.connection-badge,
#gdrive-status-badge {
  display: none !important;
}
.connection-badge.online {
  background: rgba(46, 204, 113, 0.2);
  color: #d1fae5;
}
.connection-badge.offline {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}

.gdrive-connect-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gdrive-connect-copy p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}
.gdrive-connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.gdrive-connect-actions input {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.22);
  padding: 6px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}

.tab-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.92);
  padding: 10px 18px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn[hidden],
body.role-siswa #tab-feedback-btn,
body.role-kepsek #tab-feedback-btn,
body.role-siswa #bottom-feedback-btn,
body.role-kepsek #bottom-feedback-btn,
body.role-guru #bottom-form-btn,
body.role-kesiswaan #bottom-form-btn,
body.role-kepsek #bottom-form-btn {
  display: none !important;
}

.tab-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.tab-btn.active {
  background: #fff;
  color: #1D4ED8;
  box-shadow: 0 4px 0 #FFD54A;
}

/* Main Content Area */
main {
  flex: 1;
  padding: 40px 5%;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

body.role-siswa #feedback-section,
body.role-kepsek #feedback-section {
  display: none !important;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card General Styling */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 3px solid #fff;
  box-shadow: 0 10px 0 rgba(255, 122, 61, 0.12), 0 18px 32px rgba(43, 179, 255, 0.12);
  padding: 32px;
  margin-bottom: 30px;
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-main);
  margin-bottom: 24px;
  position: relative;
  padding-left: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.card-title-hint {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 700;
  font-family: var(--font-family);
}

.card-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 8px;
  background: linear-gradient(180deg, #FFD54A, #FF7A3D);
  border-radius: 8px;
}

/* Form Laporan Harian */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.class-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.class-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.class-check:has(input:checked) {
  border-color: #2BB3FF;
  background: #E0F4FF;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group[hidden],
.profile-field[hidden],
body.role-siswa .profile-field {
  display: none !important;
}

.input-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.input-group input, .input-group select {
  font-family: var(--font-family);
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--text-main);
  background-color: #fafdfb;
  transition: var(--transition);
  outline: none;
}

.input-group input:focus, .input-group select:focus {
  border-color: var(--primary);
}

.input-group input.profile-locked,
.input-group select.profile-locked,
.input-group input.profile-locked:disabled,
.input-group select.profile-locked,
.input-group select.profile-locked:disabled,
.input-group input.profile-locked:read-only {
  background: #E8EEF4 !important;
  border-color: #CBD5E1 !important;
  color: #64748B !important;
  font-weight: 600 !important;
  cursor: not-allowed !important;
  pointer-events: none;
  opacity: 1;
  box-shadow: none;
}
.date-warn {
  margin-top: 8px;
  padding: 10px 12px;
  background: #FEF3C7;
  border: 2px dashed #F59E0B;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #92400E;
  line-height: 1.4;
}
.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #2563EB;
}

.input-group input:focus, .input-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 84, 33, 0.18);
  background-color: white;
}

/* Habits Checklist Design */
.habits-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.habits-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 30px;
}

.habit-card {
  border: 3px solid transparent;
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
  transition: var(--transition);
  position: relative;
  cursor: default;
  box-shadow: 0 6px 0 rgba(15, 23, 42, 0.06);
}

.habit-card:hover {
  transform: translateY(-4px) rotate(-0.4deg);
}

.habit-options-title {
  font-size: 12px;
  font-weight: 800;
  color: #1D4ED8;
  margin: 0 0 8px;
}
.habit-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.habit-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,255,255,0.85);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  border: 2px solid transparent;
}
.habit-option:hover { border-color: rgba(37, 99, 235, 0.25); }
.habit-option input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: #22C55E;
  flex-shrink: 0;
}

.habit-h1 { background: linear-gradient(180deg, #FFF6CC, #fff); border-color: #FFE58A; }
.habit-h2 { background: linear-gradient(180deg, #EDE7FF, #fff); border-color: #C4B5FD; }
.habit-h3 { background: linear-gradient(180deg, #DFF6FF, #fff); border-color: #7DD3FC; }
.habit-h4 { background: linear-gradient(180deg, #DCFCE7, #fff); border-color: #86EFAC; }
.habit-h5 { background: linear-gradient(180deg, #FFE8DC, #fff); border-color: #FDBA74; }
.habit-h6 { background: linear-gradient(180deg, #FFE4F1, #fff); border-color: #F9A8D4; }
.habit-h7 { background: linear-gradient(180deg, #E0F2FE, #fff); border-color: #93C5FD; }

.habit-card.checked {
  border-width: 3px;
  box-shadow: 0 8px 0 #22C55E;
  transform: translateY(-2px);
}

.habit-card.checked .habit-icon {
  transform: scale(1.08);
}

.habit-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: 0 4px 0 rgba(0,0,0,0.06);
}

.habit-header {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.habit-info h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.habit-info p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.habit-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

/* Custom Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider {
  background-color: #22C55E;
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.status-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.habit-card.checked .status-label {
  color: #16A34A;
}

/* Form Footer / Button */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.btn {
  font-family: var(--font-family);
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
}

.btn-primary {
  background: linear-gradient(90deg, #FF7A3D, #FF4D8D);
  color: white;
  border-radius: 999px;
  box-shadow: 0 6px 0 #C2410C;
}

.btn-primary:hover {
  background: linear-gradient(90deg, #FF8A54, #FF6BA8);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #C2410C;
}

.btn-secondary {
  background-color: #cbd5e1;
  color: #334155;
}

.btn-secondary:hover {
  background-color: #94a3b8;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary-light);
}

/* Dashboard Styles */
/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 24px;
  padding: 24px;
  border: 3px solid #fff;
  box-shadow: 0 8px 0 rgba(124, 92, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
}

.stat-card:nth-child(1) { box-shadow: 0 8px 0 #2BB3FF; }
.stat-card:nth-child(2) { box-shadow: 0 8px 0 #22C55E; }
.stat-card:nth-child(3) { box-shadow: 0 8px 0 #FFD54A; }
.stat-card:nth-child(4) { box-shadow: 0 8px 0 #FF6BA8; }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.blue { background-color: #e0f2fe; color: #0284c7; }
.stat-icon.green { background-color: var(--primary-light); color: var(--primary); }
.stat-icon.gold { background-color: var(--accent-light); color: #FF5421; }
.stat-icon.red { background-color: var(--danger-bg); color: var(--danger); }

.stat-details h4 {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-details .stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

/* Dashboard Filter Controls */
.filter-card {
  background: linear-gradient(90deg, #FFF7D6, #E8F7FF);
  border-radius: 24px;
  border: 3px solid #fff;
  padding: 20px 24px;
  margin-bottom: 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: 0 8px 0 rgba(43, 179, 255, 0.15);
}

.filters-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.actions-group {
  display: flex;
  gap: 12px;
}

/* Chart Container Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

.chart-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.chart-header {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
}

/* Table Card styles */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

th {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

tr:hover td {
  background-color: #fafdfb;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.badge-success { background-color: var(--success-bg); color: var(--success); }
.badge-warning { background-color: var(--warning-bg); color: var(--warning); }
.badge-danger { background-color: var(--danger-bg); color: var(--danger); }

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #1e293b;
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Mock Data Section Indicator */
.mock-indicator {
  background: linear-gradient(90deg, #FFF3C4, #FFE0F0);
  border: 3px dashed #FF7A3D;
  color: #9A3412;
  padding: 14px 20px;
  border-radius: 20px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Modal Style */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

#user-not-found-modal {
  z-index: 2000;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  padding: 30px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: var(--transition);
}

.modal.show .modal-content {
  transform: scale(1);
}

.modal-header {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Footer Section */
.site-footer {
  text-align: center;
  padding: 24px;
  margin-top: 40px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  font-size: 13px;
}

/* Spinner Animation & Utility */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
}

@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .habits-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .charts-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .habits-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .login-screen {
    padding: 12px;
    align-items: flex-start;
    padding-top: 24px;
  }
  .login-card {
    padding: 20px 16px 16px;
    border-radius: 22px;
    box-shadow: 0 8px 0 #1D4ED8, 0 16px 28px rgba(15, 23, 42, 0.18);
  }
  .login-card h1 { font-size: 22px; }

  header {
    padding: 16px 14px 18px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
  }
  .header-content {
    flex-direction: column;
    align-items: stretch;
  }
  .school-branding { gap: 10px; }
  .school-title h1 { font-size: 16px; line-height: 1.25; }
  .school-title p { font-size: 12px; }
  .header-right {
    align-items: stretch;
    width: 100%;
  }
  .user-chip-wrap {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .user-chip {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .header-right .nav-tabs {
    display: none !important;
  }
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    justify-content: space-around;
    align-items: stretch;
    gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 3px solid #FFD54A;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
  }
  .bottom-nav-btn {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 14px;
    cursor: pointer;
    min-width: 0;
  }
  .bottom-nav-btn[hidden] {
    display: none !important;
  }
  .bottom-nav-icon {
    font-size: 20px;
    line-height: 1;
  }
  .bottom-nav-label {
    line-height: 1.15;
    text-align: center;
  }
  .bottom-nav-btn.active {
    color: #1D4ED8;
    background: #E0F4FF;
  }
  main {
    padding: 16px 12px 88px;
  }
  .card {
    padding: 16px 14px;
    border-radius: 18px;
    margin-bottom: 16px;
  }
  .card-title {
    font-size: 18px;
    flex-direction: column;
    align-items: flex-start;
  }
  .quote-banner {
    padding: 14px;
    border-radius: 16px;
  }
  .quote-banner blockquote { font-size: 16px; }
  .habits-section-title {
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
  }
  .habit-card {
    padding: 14px;
  }
  .habit-card:hover {
    transform: none;
  }
  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .filter-card,
  .gdrive-connect-card,
  .mock-indicator {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }
  .gdrive-connect-actions input {
    min-width: 0;
    width: 100%;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .chart-wrapper { height: 220px; }
  .chart-header { flex-direction: column; align-items: flex-start; }
  .class-check-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .class-check {
    padding: 8px 6px;
    font-size: 11px;
  }
  .site-footer {
    display: none;
  }
}
