/* ============================================
   SUGURU - Sistem Administrasi Guru
   Mobile-First CSS Design System
   ============================================ */

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #818cf8;
  --primary-bg: #eef2ff;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);

  --nav-h: 68px;
  --header-h: 64px;
  --header-expanded-h: 106px;
  --transition: 0.28s cubic-bezier(.4,0,.2,1);
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; stroke: currentColor; }
img { max-width: 100%; display: block; }

/* ============ APP WRAPPER ============ */
#app { height: 100vh; overflow: hidden; position: relative; }

/* ============ SCREENS ============ */
.screen {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transform: translateX(30px);
  transition: opacity var(--transition), transform var(--transition);
  overflow: hidden;
}
.screen.active {
  opacity: 1; pointer-events: all;
  transform: translateX(0);
}
.screen.slide-out {
  opacity: 0; transform: translateX(-30px);
}

/* ============ LOGIN ============ */
#screen-login {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #4f46e5 0%, #06b6d4 100%);
  transform: none;
}
#screen-login.active { transform: none; }
.login-bg {
  position: absolute; inset: 0; overflow: hidden;
}
.login-blob {
  position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  top: -80px; right: -60px;
  animation: blobFloat 6s ease-in-out infinite;
}
.login-blob.b2 {
  width: 200px; height: 200px;
  bottom: -60px; left: -40px;
  animation-delay: -3s;
}
@keyframes blobFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}
.login-container {
  position: relative; z-index: 1; width: 100%; max-width: 400px; padding: 24px;
  display: flex; flex-direction: column; gap: 24px;
}
.login-logo { text-align: center; }
.logo-icon {
  width: 72px; height: 72px; border-radius: 20px;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.login-title { font-size: 1.5rem; font-weight: 700; color: #fff; line-height: 1.2; }
.login-sub { font-size: .875rem; color: rgba(255,255,255,.8); margin-top: 4px; }
.login-ta { font-size: .75rem; color: rgba(255,255,255,.6); margin-top: 2px; }
.login-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow-lg);
}
.login-card h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 20px; color: var(--text); }
.login-error {
  background: #fef2f2; border: 1px solid #fecaca; color: var(--danger);
  padding: 10px 14px; border-radius: var(--radius-xs); font-size: .875rem;
  margin-bottom: 12px;
}

/* ============ FORMS ============ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px; letter-spacing: .3px;
}
.input-wrap { position: relative; }
.input-wrap .input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-muted); pointer-events: none;
}
.input-wrap input,
.input-wrap select { padding-left: 40px !important; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .9375rem; background: var(--surface);
  color: var(--text); transition: border-color var(--transition), box-shadow var(--transition);
  outline: none; appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
textarea { min-height: 90px; resize: vertical; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px !important;
}
.btn-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.btn-eye svg { width: 18px; height: 18px; stroke: currentColor; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

/* ============ BUTTONS ============ */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: #fff; padding: 14px 20px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .9375rem;
  box-shadow: 0 4px 14px rgba(79,70,229,.35);
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:active { transform: scale(.97); box-shadow: 0 2px 8px rgba(79,70,229,.2); }
.btn-primary:disabled { opacity: .6; pointer-events: none; }
.btn-secondary {
  background: var(--surface); color: var(--text); padding: 12px 18px;
  border-radius: var(--radius-sm); font-weight: 500; font-size: .9rem;
  border: 1.5px solid var(--border);
  transition: background var(--transition);
}
.btn-secondary:active { background: var(--bg); }
.btn-danger {
  background: var(--danger); color: #fff; padding: 12px 18px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem;
  transition: opacity var(--transition);
}
.btn-danger:active { opacity: .85; }
.btn-success {
  background: var(--success); color: #fff; padding: 12px 18px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem;
}
.btn-block { width: 100%; }
.btn-icon {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text-secondary);
  transition: background var(--transition);
}
.btn-icon:active { background: var(--border); }
.btn-icon svg { width: 22px; height: 22px; }
.btn-fab {
  position: fixed; right: 20px; bottom: calc(var(--nav-h) + 20px);
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: #fff; box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; transition: transform var(--transition), box-shadow var(--transition);
}
.btn-fab:active { transform: scale(.92); }
.btn-fab svg { width: 24px; height: 24px; stroke: #fff; }
.btn-sm { padding: 8px 14px; font-size: .8125rem; border-radius: var(--radius-xs); }

/* ============ HEADER ============ */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 45%, #6366f1 100%);
  overflow: hidden;
  transition: height var(--transition);
  max-width: 600px;
  /* shadow from underneath */
  box-shadow: 0 4px 24px rgba(79,70,229,.35);
}

/* Decorative blobs inside header */
.header-blob {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.08); pointer-events: none;
}
.h-blob1 { width: 120px; height: 120px; top: -40px; right: -20px; }
.h-blob2 { width: 70px;  height: 70px;  bottom: -20px; left: 30px; animation: blobDrift 8s ease-in-out infinite; }
@keyframes blobDrift { 0%,100%{transform:translate(0,0)} 50%{transform:translate(10px,-8px)} }

/* Inner row */
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px 0 20px; height: var(--header-h); position: relative; z-index: 1;
}

/* Back button */
.header-back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.15); color: #fff;
  border: none; cursor: pointer; flex-shrink: 0;
  margin-right: 4px;
  transition: background var(--transition), transform var(--transition);
}
.header-back-btn:active { background: rgba(255,255,255,0.25); transform: scale(.93); }

/* Title block */
.header-left { display: flex; align-items: center; flex: 1; min-width: 0; }
.header-title-block { min-width: 0; }
.header-school-name {
  display: block; font-size: .625rem; font-weight: 600;
  color: rgba(255,255,255,.65); letter-spacing: .6px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity var(--transition);
}
.header-page-title {
  font-size: 1.125rem; font-weight: 700; color: #fff; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity .15s ease, transform .15s ease;
  will-change: opacity, transform;
}

/* Right action buttons */
.header-right { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

.header-action-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.12); color: #fff; border: none; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  position: relative;
}
.header-action-btn:active { background: rgba(255,255,255,0.22); transform: scale(.92); }
.header-action-btn svg { stroke: #fff; }

/* Avatar */
.header-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,.25), rgba(255,255,255,.1));
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: none; position: relative; overflow: visible; flex-shrink: 0; margin-left: 4px;
  transition: transform var(--transition);
}
.header-avatar:active { transform: scale(.9); }
#header-avatar-initials {
  font-size: .9375rem; font-weight: 800; color: #fff; line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.header-avatar-img {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
}
.header-avatar-ring {
  position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
  pointer-events: none;
  animation: ringPulse 3s ease-in-out infinite;
}
@keyframes ringPulse {
  0%,100% { opacity:.5; transform:scale(1); }
  50%      { opacity:.9; transform:scale(1.04); }
}

/* Inline search pill (shown on beranda) */
.header-search-inline {
  padding: 0 14px 10px 20px; position: relative; z-index: 1;
}
.header-search-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 99px; padding: 8px 14px; cursor: pointer;
  transition: background var(--transition);
}
.header-search-pill:active { background: rgba(255,255,255,0.22); }
.header-search-pill svg { stroke: rgba(255,255,255,.8); flex-shrink: 0; }
.header-search-pill span { font-size: .8125rem; color: rgba(255,255,255,.75); flex: 1; }

/* When beranda is active, header is taller */
.app-header.has-search { height: var(--header-expanded-h); }

/* Notif badge */
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; border-radius: 99px;
  background: #f43f5e; color: #fff;
  font-size: .5625rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid #4f46e5;
  animation: badgePop .3s cubic-bezier(.4,0,.2,1);
  line-height: 1;
}
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }

/* App content must respect header height */
.app-content {
  position: fixed;
  top: var(--header-h);
  bottom: var(--nav-h);
  left: 0; right: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transition: top var(--transition);
}
.app-content.header-expanded { top: var(--header-expanded-h); }

/* Legacy avatar class kept for compatibility */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
  color: #fff; font-weight: 700; font-size: .875rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  flex-shrink: 0;
}

/* ============ BOTTOM NAV ============ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(226,232,240,0.8);
  display: flex; align-items: stretch;
  box-shadow: 0 -4px 24px rgba(79,70,229,.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: #94a3b8;
  transition: color .2s ease; position: relative;
  padding-top: 6px; border: none; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg {
  width: 22px; height: 22px; stroke: currentColor; fill: none;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), stroke .2s ease;
  stroke-width: 2;
}
.nav-item span {
  font-size: .5875rem; font-weight: 600; letter-spacing: .3px;
  transition: color .2s ease;
}
/* Active state */
.nav-item.active { color: var(--primary); }
.nav-item.active svg {
  stroke: var(--primary);
  transform: translateY(-3px) scale(1.12);
  filter: drop-shadow(0 2px 6px rgba(79,70,229,.35));
}
/* Active dot */
.nav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px;
  background: linear-gradient(90deg, #4f46e5, #818cf8);
  border-radius: 0 0 4px 4px;
  animation: navSlide .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes navSlide { from { width:0; opacity:0; } to { width:28px; opacity:1; } }
/* Active bg pill */
.nav-item.active::after {
  content: '';
  position: absolute; top: 4px;
  width: 44px; height: 32px; border-radius: 16px;
  background: var(--primary-bg);
  z-index: -1;
  animation: navPill .2s ease;
}
@keyframes navPill { from { opacity:0; transform:scale(.7); } to { opacity:1; transform:scale(1); } }
.nav-item:active { opacity: .75; }

/* ============ APP CONTENT ============ */
/* (overridden in HEADER section above for transitions) */
.page { padding: 16px; animation: pageFade .25s ease; }
@keyframes pageFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ CARDS ============ */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:active { transform: scale(.99); }
.card-header {
  padding: 16px 16px 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: .9375rem; font-weight: 600; }
.card-body { padding: 16px; }
.card-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.card-list-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); transition: background var(--transition);
  cursor: pointer;
}
.card-list-item:last-child { border-bottom: none; }
.card-list-item:active { background: var(--bg); }

/* ============ SKELETON LOADING ============ */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.xs { width: 40%; }
.skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.skeleton-badge { width: 60px; height: 24px; border-radius: 12px; }

/* ============ BERANDA ============ */
.greeting-card {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 60%, #06b6d4 100%);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px; position: relative; overflow: hidden;
  box-shadow: 0 6px 24px rgba(79,70,229,.3);
}
.greeting-card::before {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.greeting-card h2 { font-size: 1.125rem; font-weight: 600; color: #fff; }
.greeting-card p { font-size: .8125rem; color: rgba(255,255,255,.8); margin-top: 4px; }
.greeting-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px;
}
.stat-pill {
  background: rgba(255,255,255,.15); backdrop-filter: blur(4px);
  border-radius: 10px; padding: 10px 8px; text-align: center;
  border: 1px solid rgba(255,255,255,.2);
}
.stat-pill .num { font-size: 1.25rem; font-weight: 700; color: #fff; line-height: 1; }
.stat-pill .lbl { font-size: .625rem; color: rgba(255,255,255,.8); margin-top: 2px; letter-spacing: .3px; text-transform: uppercase; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-header h3 { font-size: .9375rem; font-weight: 700; }
.section-header a, .section-header button { font-size: .8125rem; color: var(--primary); font-weight: 500; background: none; }

.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.qa-item {
  background: var(--surface); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 14px 8px; text-align: center;
  cursor: pointer; transition: transform var(--transition), box-shadow var(--transition);
}
.qa-item:active { transform: scale(.95); }
.qa-icon {
  width: 44px; height: 44px; border-radius: 14px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
}
.qa-icon svg { width: 22px; height: 22px; }
.qa-item span { font-size: .6875rem; font-weight: 600; color: var(--text-secondary); }
.qa-blue { background: #eff6ff; color: #3b82f6; }
.qa-green { background: #f0fdf4; color: #10b981; }
.qa-orange { background: #fff7ed; color: #f97316; }
.qa-red { background: #fef2f2; color: #ef4444; }
.qa-purple { background: var(--primary-bg); color: var(--primary); }
.qa-cyan { background: #ecfeff; color: #06b6d4; }

/* ============ ACTIVITY ITEM ============ */
.activity-item {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.activity-dot svg { width: 18px; height: 18px; }
.activity-info { flex: 1; min-width: 0; }
.activity-info p { font-size: .875rem; font-weight: 500; }
.activity-info span { font-size: .75rem; color: var(--text-muted); }

/* ============ BADGES ============ */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px;
  border-radius: 99px; font-size: .6875rem; font-weight: 600; letter-spacing: .3px;
}
.badge-green { background: #f0fdf4; color: #16a34a; }
.badge-yellow { background: #fefce8; color: #ca8a04; }
.badge-red { background: #fef2f2; color: #dc2626; }
.badge-blue { background: #eff6ff; color: #2563eb; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-purple { background: var(--primary-bg); color: var(--primary); }

/* ============ ABSENSI PAGE ============ */
.absen-header { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.absen-student-list { display: flex; flex-direction: column; gap: 8px; }
.absen-item {
  background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}
.absen-name { flex: 1; min-width: 0; }
.absen-name .no { font-size: .75rem; color: var(--text-muted); }
.absen-name .nm { font-size: .9375rem; font-weight: 500; }
.absen-btns { display: flex; gap: 4px; }
.absen-btn {
  width: 38px; height: 38px; border-radius: 10px; font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border); color: var(--text-muted);
  transition: all .15s;
}
.absen-btn.active-H { background: var(--success); border-color: var(--success); color: #fff; }
.absen-btn.active-S { background: var(--warning); border-color: var(--warning); color: #fff; }
.absen-btn.active-I { background: var(--info); border-color: var(--info); color: #fff; }
.absen-btn.active-A { background: var(--danger); border-color: var(--danger); color: #fff; }

.rekap-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 16px; }
.rekap-box { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 8px; text-align: center; box-shadow: var(--shadow); }
.rekap-box .num { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.rekap-box .lbl { font-size: .6875rem; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .3px; }
.num-H { color: var(--success); }
.num-S { color: var(--warning); }
.num-I { color: var(--info); }
.num-A { color: var(--danger); }

/* ============ NILAI PAGE ============ */
.nilai-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nilai-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.nilai-table th {
  background: var(--bg); padding: 10px 12px; text-align: left;
  font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.nilai-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.nilai-table tr:last-child td { border-bottom: none; }
.nilai-table tr:hover td { background: var(--bg); }
.nilai-input { width: 60px; padding: 6px 8px; font-size: .875rem; text-align: center; }

/* ============ PELANGGARAN ============ */
.poin-bar { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.poin-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--success), var(--warning) 50%, var(--danger)); transition: width .5s ease; }
.poin-low { background: var(--success); }
.poin-mid { background: var(--warning); }
.poin-high { background: var(--danger); }
.pelanggaran-item {
  background: var(--surface); border-radius: var(--radius-sm); padding: 14px 16px;
  margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform var(--transition);
}
.pelanggaran-item:active { transform: scale(.99); }
.pelanggaran-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }

/* ============ PROFIL ============ */
.profil-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  padding: 28px 20px 40px; text-align: center; border-radius: 0 0 28px 28px;
  margin: -16px -16px 0;
}
.profil-avatar-wrap { position: relative; display: inline-block; margin-bottom: 12px; }
.profil-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.2); color: #fff;
  font-size: 2rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid rgba(255,255,255,0.4); margin: 0 auto;
}
.profil-name { font-size: 1.25rem; font-weight: 700; color: #fff; }
.profil-role { font-size: .8125rem; color: rgba(255,255,255,.8); margin-top: 4px; }
.profil-mapel { font-size: .75rem; color: rgba(255,255,255,.7); margin-top: 2px; }

.menu-section { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-top: 16px; }
.menu-item {
  display: flex; align-items: center; gap: 14px; padding: 15px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background var(--transition);
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg); }
.menu-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.menu-icon svg { width: 20px; height: 20px; }
.menu-label { flex: 1; }
.menu-label p { font-size: .9375rem; font-weight: 500; }
.menu-label small { font-size: .75rem; color: var(--text-muted); }
.menu-chevron { width: 18px; height: 18px; color: var(--text-muted); }

/* ============ ADMIN PANEL ============ */
.admin-tabs-wrap {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  padding: 0 0 8px;
  margin: -16px -16px 16px;
  padding: 12px 16px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.admin-tabs {
  display: flex; gap: 6px; overflow-x: auto;
  scrollbar-width: none;
  /* Fade edges kiri-kanan untuk hint ada konten */
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 12px), transparent 100%);
  padding: 2px 10px;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  flex-shrink: 0; padding: 8px 16px; border-radius: 99px;
  font-size: .8125rem; font-weight: 600; color: var(--text-secondary);
  background: var(--surface); border: 1.5px solid var(--border);
  transition: all var(--transition); white-space: nowrap;
}
.admin-tab.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}

.data-controls { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.search-input {
  flex: 1; padding: 10px 14px 10px 36px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .875rem;
  background: var(--surface); position: relative;
}
.search-wrap { position: relative; flex: 1; }
.search-wrap svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}
.search-wrap input { padding-left: 32px !important; }

.data-table-wrap {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.data-table th {
  background: var(--bg); padding: 10px 12px; text-align: left;
  font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid var(--border);
  white-space: nowrap; cursor: pointer; user-select: none;
}
.data-table th:hover { background: #e2e8f0; }
.data-table th .sort-icon { display: inline; margin-left: 4px; color: var(--text-muted); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.table-actions { display: flex; gap: 4px; }
.table-actions button { padding: 5px 10px; border-radius: var(--radius-xs); font-size: .75rem; font-weight: 600; }
.btn-edit { background: var(--primary-bg); color: var(--primary); }
.btn-del { background: #fef2f2; color: var(--danger); }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); }
.pagination-info { font-size: .75rem; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 4px; }
.page-btn {
  width: 32px; height: 32px; border-radius: var(--radius-xs);
  font-size: .8125rem; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); color: var(--text-secondary);
  transition: all var(--transition);
}
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; pointer-events: none; }

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .2s ease;
}
.modal-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-container {
  background: var(--surface); border-radius: var(--radius);
  width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: slideUp .25s cubic-bezier(.4,0,.2,1);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: var(--surface); z-index: 1;
}
.modal-header h3 { font-size: 1.0625rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
}
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ============ BOTTOM SHEET ============ */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.4); animation: fadeIn .2s ease;
}
.sheet-overlay.hidden { display: none; }
.sheet-container {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-radius: 24px 24px 0 0;
  max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: sheetSlide .28s cubic-bezier(.4,0,.2,1);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@keyframes sheetSlide { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle {
  width: 40px; height: 4px; background: var(--border); border-radius: 99px;
  margin: 12px auto 4px;
}
#sheet-content { padding: 0 16px 20px; }
.sheet-title { font-size: 1.0625rem; font-weight: 700; padding: 12px 0 16px; }

/* ============ TOAST ============ */
#toast-container { position: fixed; bottom: calc(var(--nav-h) + 12px); left: 16px; right: 16px; z-index: 500; display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: #1e293b; color: #fff; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); font-size: .875rem; font-weight: 500;
  animation: toastIn .3s cubic-bezier(.4,0,.2,1);
  pointer-events: all;
}
.toast.success { background: #065f46; border-left: 4px solid var(--success); }
.toast.error { background: #7f1d1d; border-left: 4px solid var(--danger); }
.toast.info { background: #1e3a5f; border-left: 4px solid var(--info); }
.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast.out { animation: toastOut .3s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(20px); } }

/* ============ CONFIRM DIALOG ============ */
.confirm-dialog {
  background: var(--surface); border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 320px; margin: auto;
  box-shadow: var(--shadow-lg); animation: slideUp .25s ease;
}
.confirm-dialog h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 10px; }
.confirm-dialog p { font-size: .9rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn-secondary, .confirm-actions .btn-danger { flex: 1; text-align: center; }

/* ============ FILTER BAR ============ */
.filter-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 99px; font-size: .8125rem; font-weight: 500;
  background: var(--surface); border: 1.5px solid var(--border); color: var(--text-secondary);
  transition: all var(--transition);
}
.filter-chip.active { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }

/* ============ EMPTY STATE ============ */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state svg { width: 64px; height: 64px; color: var(--text-muted); margin: 0 auto 16px; }
.empty-state h3 { font-size: 1.0625rem; font-weight: 600; margin-bottom: 6px; }
.empty-state p { font-size: .875rem; color: var(--text-muted); line-height: 1.5; }
.empty-state .btn-primary { margin: 16px auto 0; width: fit-content; padding: 12px 24px; }

/* ============ LIST ITEMS ============ */
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--surface); border-radius: var(--radius-sm); margin-bottom: 8px;
  box-shadow: var(--shadow); cursor: pointer; transition: transform var(--transition);
}
.list-item:active { transform: scale(.99); }
.list-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem;
}
.list-info { flex: 1; min-width: 0; }
.list-info p { font-size: .9375rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-info small { font-size: .75rem; color: var(--text-muted); }
.list-meta { text-align: right; flex-shrink: 0; }
.list-meta p { font-size: .875rem; font-weight: 600; }
.list-meta small { font-size: .6875rem; color: var(--text-muted); }

/* ============ SECTION DIVIDER ============ */
.section-divider {
  font-size: .6875rem; font-weight: 700; color: var(--text-muted); letter-spacing: .8px;
  text-transform: uppercase; padding: 16px 0 8px;
}

/* ============ IMPORT PAGE ============ */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px 20px; text-align: center; background: var(--bg);
  cursor: pointer; transition: border-color var(--transition), background var(--transition);
}
.upload-zone.drag-over { border-color: var(--primary); background: var(--primary-bg); }
.upload-zone svg { width: 48px; height: 48px; color: var(--text-muted); margin: 0 auto 12px; }
.upload-zone p { font-size: .9375rem; font-weight: 500; color: var(--text-secondary); }
.upload-zone small { font-size: .8125rem; color: var(--text-muted); }

/* ============ SETTINGS ============ */
.settings-group { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; }
.settings-group-title { font-size: .75rem; font-weight: 700; color: var(--text-muted); letter-spacing: .5px; text-transform: uppercase; padding: 14px 16px 4px; }
.settings-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition);
}
.settings-item:last-child { border-bottom: none; }
.settings-item:active { background: var(--bg); }
.settings-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.settings-icon svg { width: 18px; height: 18px; }
.settings-label { flex: 1; }
.settings-label p { font-size: .9375rem; font-weight: 500; }
.settings-label small { font-size: .75rem; color: var(--text-muted); }
.settings-chevron { width: 16px; height: 16px; color: var(--text-muted); }

/* ============ PROGRESS / LOADING ============ */
.loading-bar {
  position: fixed; top: 0; left: 0; z-index: 9999;
  height: 3px; background: var(--primary);
  transition: width .4s ease;
}

/* ============ CHIPS ============ */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 4px 12px; background: var(--bg); border-radius: 99px;
  font-size: .75rem; font-weight: 500; color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ============ SWITCH ============ */
.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; background: var(--border); border-radius: 99px; cursor: pointer;
  transition: background .2s;
}
.switch-slider::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; left: 3px; top: 3px; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::after { transform: translateX(20px); }

/* ============ RESPONSIVE DESKTOP ============ */

/* Mobile default — semua full-width, tidak ada phone frame */
/* Tidak ada :root override di sini agar HP tidak terdampak */

@media (hover: hover) and (min-width: 768px) {
  /* Hanya berlaku di perangkat dengan pointer/mouse (desktop/laptop),
     bukan touchscreen HP yang kebetulan layarnya lebar */

  :root { --app-w: 480px; }

  body {
    background: #bec8d8;
    background-image:
      radial-gradient(circle at 20% 30%, rgba(79,70,229,.08) 0%, transparent 50%),
      radial-gradient(circle at 80% 70%, rgba(6,182,212,.06) 0%, transparent 50%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
  }

  /* Phone frame container */
  #app {
    width: var(--app-w);
    max-width: var(--app-w);
    height: 100vh;
    max-height: 900px;
    margin: 0 auto;
    position: relative;
    background: var(--bg);
    border-radius: 32px;
    overflow: hidden;
    box-shadow:
      0 0 0 1px rgba(255,255,255,.25),
      0 20px 60px rgba(0,0,0,.28),
      0 4px 12px rgba(0,0,0,.12);
  }

  /* Header: ikut lebar app, rounded atas */
  .app-header {
    width: var(--app-w);
    left: 50%;
    transform: translateX(-50%);
    border-radius: 32px 32px 0 0;
  }

  /* Content area */
  .app-content {
    width: var(--app-w);
    left: 50%;
    transform: translateX(-50%);
  }

  /* Bottom nav: rounded bawah */
  .bottom-nav {
    width: var(--app-w);
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 32px 32px;
  }

  /* Search overlay */
  #global-search-overlay {
    width: var(--app-w);
    left: 50%;
    transform: translateX(-50%);
  }

  /* Toast */
  #toast-container {
    width: calc(var(--app-w) - 32px);
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }

  /* FAB */
  .btn-fab { right: calc(50% - var(--app-w)/2 + 20px); }

  .modal-overlay { padding: 24px; }

  /* Scrollbar tipis */
  .app-content::-webkit-scrollbar { width: 3px; }
  .app-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
  .app-content::-webkit-scrollbar-track { background: transparent; }
}

/* ============ UTILITIES ============ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ============ NOTIF BADGE ============ */
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; border-radius: 99px;
  background: var(--danger); color: #fff;
  font-size: .625rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid var(--surface);
  animation: badgePop .3s cubic-bezier(.4,0,.2,1);
}
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }

/* ============ GLOBAL SEARCH ============ */
.global-search-overlay {
  position: fixed; top: 0; left: 0; right: 0; z-index: 400;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(79,70,229,.18);
  animation: searchDrop .22s cubic-bezier(.4,0,.2,1);
}
@keyframes searchDrop {
  from { opacity:0; transform:translateY(-16px) scale(.98); }
  to   { opacity:1; transform:none; }
}
.global-search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg,#4338ca,#4f46e5);
}
.global-search-bar svg { flex-shrink: 0; color: rgba(255,255,255,.8); }
.global-search-bar input {
  flex: 1; border: none; outline: none; font-size: 1rem;
  font-family: inherit; background: transparent; color: #fff;
}
.global-search-bar input::placeholder { color: rgba(255,255,255,.6); }
.global-search-bar button { color: rgba(255,255,255,.8); padding: 4px; line-height: 0; }
.global-search-results {
  max-height: 60vh; overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition);
}
.search-result-item:active { background: var(--bg); }
.search-result-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.search-result-icon svg { width: 18px; height: 18px; }
.search-result-info { flex: 1; min-width: 0; }
.search-result-info p { font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-info small { font-size: .75rem; color: var(--text-muted); }
.search-result-type { font-size: .625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.search-empty { text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: .875rem; }

/* ============ NOTIFIKASI PAGE ============ */
.notif-item {
  display: flex; gap: 12px; padding: 14px 16px;
  background: var(--surface); border-radius: var(--radius-sm);
  margin-bottom: 8px; box-shadow: var(--shadow);
  border-left: 4px solid var(--border);
}
.notif-item.danger { border-left-color: var(--danger); }
.notif-item.warning { border-left-color: var(--warning); }
.notif-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-icon svg { width: 20px; height: 20px; }
.notif-info { flex: 1; min-width: 0; }
.notif-info h4 { font-size: .9375rem; font-weight: 600; }
.notif-info p { font-size: .8125rem; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
.notif-info small { font-size: .75rem; color: var(--text-muted); }

/* ============ STATISTIK / CHART ============ */
.chart-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px;
}
.chart-card h3 { font-size: .9375rem; font-weight: 700; margin-bottom: 16px; }
.chart-wrap { position: relative; height: 200px; }
.chart-wrap canvas { max-height: 200px; }
.stat-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 16px; }
.stat-box {
  background: var(--surface); border-radius: var(--radius-sm); padding: 14px;
  box-shadow: var(--shadow); text-align: center;
}
.stat-box .big-num { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-box .label { font-size: .6875rem; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .3px; }

/* ============ JADWAL ============ */
.jadwal-day-header {
  background: var(--primary-bg); color: var(--primary);
  font-size: .8125rem; font-weight: 700; padding: 8px 14px;
  border-radius: var(--radius-xs); margin: 12px 0 8px; letter-spacing: .3px;
  text-transform: uppercase;
}
.jadwal-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border-radius: var(--radius-sm);
  margin-bottom: 6px; box-shadow: var(--shadow);
}
.jadwal-time {
  text-align: center; flex-shrink: 0; min-width: 52px;
}
.jadwal-time .jam { font-size: .8125rem; font-weight: 700; color: var(--primary); }
.jadwal-time .ke  { font-size: .625rem; color: var(--text-muted); }
.jadwal-info { flex: 1; min-width: 0; }
.jadwal-info p { font-size: .9375rem; font-weight: 500; }
.jadwal-info small { font-size: .75rem; color: var(--text-muted); }

/* ============ CATATAN SISWA ============ */
.catatan-item {
  background: var(--surface); border-radius: var(--radius-sm); padding: 14px 16px;
  margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform var(--transition);
  border-left: 4px solid var(--border);
}
.catatan-item:active { transform: scale(.99); }
.catatan-item.kat-akademik { border-left-color: var(--primary); }
.catatan-item.kat-sikap { border-left-color: var(--warning); }
.catatan-item.kat-kesehatan { border-left-color: var(--success); }
.catatan-item.kat-umum { border-left-color: var(--text-muted); }
.catatan-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.catatan-body { font-size: .875rem; color: var(--text-secondary); line-height: 1.5; }
.catatan-footer { font-size: .75rem; color: var(--text-muted); margin-top: 6px; }

/* ============ RAPOR / PRINT ============ */
.rapor-header { text-align: center; margin-bottom: 24px; }
.rapor-header h2 { font-size: 1rem; font-weight: 700; }
.rapor-header p  { font-size: .875rem; color: var(--text-secondary); }
.rapor-section { margin-bottom: 20px; }
.rapor-section h3 { font-size: .9375rem; font-weight: 700; border-bottom: 2px solid var(--primary); padding-bottom: 6px; margin-bottom: 12px; color: var(--primary); }
.rapor-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.rapor-table th, .rapor-table td { padding: 8px 10px; border: 1px solid var(--border); }
.rapor-table th { background: var(--bg); font-weight: 600; text-align: left; }
.rapor-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.rapor-summary .box { background: var(--bg); border-radius: var(--radius-xs); padding: 10px; text-align: center; }
.rapor-summary .box .num { font-size: 1.25rem; font-weight: 700; }
.rapor-summary .box .lbl { font-size: .6875rem; color: var(--text-muted); margin-top: 2px; }

/* Export Filter Sheet */
.export-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ============ FOTO PROFIL ============ */
.profil-foto-wrap { position: relative; display: inline-block; }
.foto-upload-btn {
  position: absolute; bottom: 0; right: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); cursor: pointer;
}
.foto-upload-btn svg { width: 14px; height: 14px; }
.profil-avatar-img {
  width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,0.4);
}

/* ============ PRINT STYLES ============ */
@media print {
  body { background: #fff; overflow: auto; }
  .app-header, .bottom-nav, .btn-fab, #toast-container,
  #modal-overlay, #sheet-overlay, #confirm-overlay,
  #global-search-overlay { display: none !important; }
  .app-content { position: static; overflow: visible; }
  .page { padding: 0; }
  .card, .data-table-wrap, .rapor-section { box-shadow: none; border: 1px solid #e2e8f0; }
  @page { margin: 1.5cm; }
}

