:root {
  --navy: #0d2e5a;
  --navy-2: #143f78;
  --blue: #287dce;
  --blue-2: #1f63ae;
  --blue-soft: #eaf3ff;
  --green: #10976e;
  --orange: #e28a00;
  --teal: #0b8796;
  --red: #c73b4b;
  --ink: #102442;
  --muted: #667690;
  --line: #dce6f2;
  --surface: #ffffff;
  --background: #f3f7fd;
  --shadow: 0 16px 42px rgba(18, 55, 96, .12);
  --shadow-soft: 0 8px 24px rgba(18, 55, 96, .08);
  --radius: 18px;
  --sidebar-width: 270px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--blue);
}

/* Login */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr);
  background: #fff;
}
.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px;
  background:
    radial-gradient(circle at 78% 18%, rgba(75, 148, 232, .45), transparent 20%),
    linear-gradient(145deg, #0a2850, #134e91 64%, #1d73bf);
  color: #fff;
}
.visual-grid {
  position: absolute;
  inset: 0;
  opacity: .12;
  background-image:
    linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: skewY(-5deg) scale(1.2);
}
.visual-content { position: relative; max-width: 620px; }
.login-logo {
  width: 92px;
  height: 92px;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,.2));
  margin-bottom: 24px;
}
.visual-content .eyebrow { color: #bfe0ff; }
.visual-content h1 {
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1.03;
  margin: 0 0 20px;
  letter-spacing: -.04em;
}
.visual-content > p:not(.eyebrow) {
  max-width: 560px;
  font-size: 18px;
  line-height: 1.75;
  color: #e4efff;
}
.feature-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.feature-pills span {
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  font-size: 13px;
}
.login-panel { display: grid; place-items: center; padding: 48px; }
.login-card { width: min(440px, 100%); }
.login-card h2 { margin: 0 0 10px; font-size: 34px; letter-spacing: -.03em; }
.login-card .muted { margin: 0 0 30px; line-height: 1.6; }
.mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 30px; }
.mobile-brand img { width: 52px; height: 52px; }
.mobile-brand strong, .mobile-brand small { display: block; }
.mobile-brand small { color: var(--muted); margin-top: 4px; font-size: 11px; }
.form-label { display: block; font-size: 13px; font-weight: 750; margin: 18px 0 8px; }
.input-icon { position: relative; }
.input-icon > span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8b9bb1;
  font-size: 13px;
}
.input-icon input { padding-left: 42px; padding-right: 44px; }
.login-options {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 18px 0 22px;
  color: var(--muted);
  font-size: 13px;
}
.login-options label { display: flex; align-items: center; gap: 8px; }
.demo-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: #355578;
  font-size: 12px;
  line-height: 1.5;
}

/* Inputs and buttons */
input, select, textarea {
  width: 100%;
  border: 1px solid #cfdaea;
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: #5b9ce0;
  box-shadow: 0 0 0 4px rgba(46, 131, 216, .13);
}
textarea { min-height: 108px; resize: vertical; }
.primary-button, .secondary-button, .danger-button, .ghost-button, .link-button, .icon-button {
  border: 0;
  border-radius: 11px;
  font-weight: 750;
}
.primary-button {
  padding: 12px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-2), var(--blue));
  box-shadow: 0 8px 18px rgba(35, 112, 191, .22);
}
.primary-button:hover { filter: brightness(1.04); transform: translateY(-1px); }
.secondary-button {
  padding: 11px 16px;
  color: #164a7d;
  background: #e8f2fc;
}
.secondary-button:hover { background: #dcecfb; }
.danger-button { padding: 10px 14px; color: #fff; background: var(--red); }
.ghost-button { padding: 10px 14px; color: var(--ink); background: #f1f5fa; }
.link-button { padding: 0; color: var(--blue-2); background: transparent; }
.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  color: #48617f;
  background: #eef4fb;
}
.icon-button:hover { background: #e1ebf7; }
.password-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.full { width: 100%; }
.compact { padding: 9px 13px; font-size: 13px; }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 12px;
  background: linear-gradient(180deg, #0b2a54, #103b70 72%, #0e3769);
  color: #fff;
  overflow-y: auto;
  box-shadow: 8px 0 28px rgba(11, 42, 84, .14);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.brand img { width: 48px; height: 48px; flex: 0 0 auto; }
.brand strong { display: block; font-size: 16px; }
.brand small { display: block; margin-top: 4px; font-size: 9px; color: #bfd3ec; letter-spacing: .02em; }
.user-chip {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: rgba(255,255,255,.08);
}
.avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #3f97ed;
  font-weight: 900;
}
.user-copy { min-width: 0; }
.user-copy strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.user-copy small { display: block; margin-top: 5px; color: #c8d9ee; font-size: 10px; }
.main-nav { display: grid; gap: 5px; }
.nav-item, .logout-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  color: #eef6ff;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 720;
}
.nav-item span, .logout-button span { width: 18px; text-align: center; color: #cde4ff; }
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { background: linear-gradient(90deg, #297bd0, #3389df); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.logout-button { margin-top: auto; color: #ffe6e7; background: rgba(188, 68, 86, .23); }
.logout-button:hover { background: rgba(188, 68, 86, .34); }
.sidebar-footer { padding: 14px 8px 2px; text-align: center; color: #8fb0d4; font-size: 10px; }
.sidebar-backdrop { display: none; }
.main-area { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 32px 18px;
  background: rgba(243, 247, 253, .92);
  backdrop-filter: blur(14px);
}
.topbar h1 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.topbar p { margin: 5px 0 0; color: var(--muted); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.date-badge {
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
  color: #234466;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(22, 59, 99, .04);
}
.mobile-menu-button { display: none; }
.page-content { padding: 0 32px 34px; }

/* General content */
.page-stack { display: grid; gap: 20px; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.card-header h2, .card-header h3 { margin: 0; font-size: 16px; }
.card-body { padding: 20px; }
.hero-banner {
  position: relative;
  overflow: hidden;
  min-height: 128px;
  display: flex;
  align-items: center;
  padding: 26px 32px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(100deg, #15549d, #287dce);
  box-shadow: var(--shadow);
}
.hero-banner::after {
  content: "";
  position: absolute;
  right: 68px;
  width: 94px;
  height: 94px;
  transform: rotate(45deg);
  border-radius: 25px 70px 25px 70px;
  background: rgba(255,255,255,.12);
}
.hero-banner h2 { position: relative; z-index: 1; margin: 0 0 9px; font-size: clamp(24px, 3vw, 34px); font-style: italic; }
.hero-banner p { position: relative; z-index: 1; margin: 0; color: #e5f1ff; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 108px;
  padding: 20px;
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 10px 22px rgba(26, 80, 125, .13);
}
.metric-card.green { background: var(--green); }
.metric-card.blue { background: var(--blue-2); }
.metric-card.orange { background: var(--orange); }
.metric-card.teal { background: var(--teal); }
.metric-label { font-size: 12px; opacity: .92; }
.metric-value { margin-top: 10px; font-size: 30px; font-weight: 900; }
.metric-icon { position: absolute; right: 18px; bottom: -4px; font-size: 52px; opacity: .18; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .5fr); gap: 20px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-action {
  min-height: 95px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f8fbff;
  color: var(--ink);
  text-align: left;
}
.quick-action:hover { border-color: #a9c8e9; background: #eff7ff; transform: translateY(-1px); }
.quick-action span { font-size: 22px; }
.quick-action strong { font-size: 13px; }
.quick-action small { color: var(--muted); }
.section-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.toolbar-group { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.field { min-width: 160px; }
.field.grow { min-width: 240px; flex: 1; }
.field label { display: block; margin: 0 0 6px; color: #52657e; font-size: 11px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Table */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid #e5edf6; text-align: left; vertical-align: top; }
th { color: #52677f; background: #f7faff; font-size: 11px; letter-spacing: .03em; text-transform: uppercase; }
td { font-size: 13px; }
tbody tr:hover { background: #fbfdff; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-actions button { padding: 7px 9px; border: 0; border-radius: 8px; font-size: 11px; font-weight: 750; }
.action-edit { color: #13588e; background: #e7f2fc; }
.action-delete { color: #a42636; background: #fdecee; }
.action-open { color: #176a4b; background: #e5f7ef; }
.empty-state { padding: 50px 24px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { display: block; margin-bottom: 10px; font-size: 36px; opacity: .45; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.badge.green { color: #0b6b4b; background: #dff6ec; }
.badge.blue { color: #15588f; background: #e4f1fd; }
.badge.orange { color: #8b5300; background: #fff0d7; }
.badge.red { color: #a12636; background: #fde7ea; }
.badge.gray { color: #58697f; background: #edf1f6; }
.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eff6;
}
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2d78c5, #3f98e8); }

/* Attendance */
.summary-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.summary-tile { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.summary-tile small { color: var(--muted); }
.summary-tile strong { display: block; margin-top: 4px; font-size: 22px; }
.status-selector { display: flex; gap: 5px; min-width: 215px; }
.status-selector input { position: absolute; opacity: 0; pointer-events: none; }
.status-selector label {
  width: 38px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #d9e3ee;
  border-radius: 9px;
  color: #607087;
  background: #fff;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.status-selector input:checked + label[data-status="H"] { color: #fff; border-color: var(--green); background: var(--green); }
.status-selector input:checked + label[data-status="S"] { color: #fff; border-color: var(--orange); background: var(--orange); }
.status-selector input:checked + label[data-status="I"] { color: #fff; border-color: var(--blue); background: var(--blue); }
.status-selector input:checked + label[data-status="A"] { color: #fff; border-color: var(--red); background: var(--red); }

/* Grades */
.assessment-list { display: grid; gap: 10px; }
.assessment-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}
.assessment-item.active { border-color: #4b93d7; background: #eef7ff; box-shadow: 0 0 0 3px rgba(45, 127, 206, .08); }
.assessment-item strong { display: block; font-size: 13px; }
.assessment-item small { color: var(--muted); }
.score-input { width: 86px; text-align: center; }
.grade-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 20px; }

/* Modules */
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.module-card { padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-soft); }
.module-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: #eaf3ff; font-size: 24px; }
.module-card h3 { margin: 14px 0 6px; font-size: 16px; }
.module-card p { min-height: 38px; margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.module-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.module-actions { display: flex; gap: 8px; }
.upload-zone {
  padding: 28px;
  border: 2px dashed #b8cee5;
  border-radius: 16px;
  background: #f8fbff;
  text-align: center;
}
.upload-zone input { margin-top: 12px; }

/* Profile */
.profile-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; }
.profile-card { padding: 24px; text-align: center; }
.profile-avatar {
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #1d63ac, #3d98e8);
  font-size: 34px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(36, 109, 184, .25);
}
.profile-card h2 { margin: 0 0 6px; }
.profile-card p { margin: 0 0 16px; color: var(--muted); }
.info-list { display: grid; gap: 9px; text-align: left; }
.info-list div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.info-list span { color: var(--muted); }
.tabs { display: flex; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.tab-button { padding: 9px 13px; border: 0; border-radius: 9px; color: #52677f; background: transparent; font-weight: 800; }
.tab-button.active { color: #155792; background: #e7f2fc; }
.tab-panel { padding: 20px; }
.backup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.backup-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fafcff; }
.backup-card h4 { margin: 0 0 7px; }
.backup-card p { min-height: 52px; margin: 0 0 13px; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* Modal */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 20, 40, .6); backdrop-filter: blur(5px); }
.modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(4, 20, 40, .35);
  animation: modalIn .18s ease-out;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 22px; }
.modal-body { padding: 20px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* Toast */
.toast-container { position: fixed; z-index: 150; right: 20px; bottom: 20px; display: grid; gap: 10px; }
.toast {
  min-width: 270px;
  max-width: 380px;
  padding: 13px 15px;
  border-radius: 13px;
  color: #fff;
  background: #173d66;
  box-shadow: var(--shadow);
  animation: toastIn .2s ease-out;
}
.toast.success { background: #0f8763; }
.toast.error { background: #bd3949; }
.toast.warning { background: #b26a00; }
@keyframes toastIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* Utility */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Responsive */
@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .grade-layout { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 940px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 28px; background: linear-gradient(180deg, #f7fbff, #fff); }
  .mobile-brand { display: flex; }
  .sidebar { transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 45; display: block; pointer-events: none; opacity: 0; background: rgba(5, 22, 42, .45); transition: opacity .22s; }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  .main-area { margin-left: 0; }
  .topbar { padding: 18px 20px 14px; }
  .page-content { padding: 0 20px 28px; }
  .mobile-menu-button { display: inline-grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border: 0; border-radius: 11px; color: #164b7c; background: #e5f0fb; }
  .topbar > div:nth-child(2) { margin-right: auto; }
  #quickAddButton { display: none; }
  .grade-layout, .profile-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .topbar { align-items: flex-start; gap: 10px; flex-wrap: wrap; }
  .topbar h1 { font-size: 22px; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .date-badge { flex: 1; text-align: center; }
  #quickAddButton { display: none; }
  .hero-banner { padding: 23px; min-height: 138px; }
  .hero-banner::after { right: -5px; }
  .metric-grid, .summary-row, .module-grid, .backup-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 96px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .section-toolbar { align-items: stretch; }
  .toolbar-group { width: 100%; }
  .field, .field.grow { min-width: 100%; }
  .toolbar-group > button { flex: 1; }
  .quick-grid { grid-template-columns: 1fr; }
  .card-header { align-items: flex-start; flex-direction: column; }
  .table-actions { min-width: 130px; }
  th, td { padding: 11px 10px; }
  .modal-root { padding: 10px; }
  .modal-card { max-height: 94vh; border-radius: 16px; }
  .toast-container { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
}
@media print {
  .sidebar, .topbar, .section-toolbar, .table-actions, .no-print, .toast-container { display: none !important; }
  .main-area { margin: 0; }
  .page-content { padding: 0; }
  .card, .metric-card, .hero-banner { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}

/* Data siswa dan kelas */
.student-summary { grid-template-columns: repeat(4, 1fr); }
.class-chip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.class-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}
.class-chip strong, .class-chip small { display: block; }
.class-chip strong { font-size: 16px; }
.class-chip small { margin-top: 4px; color: var(--muted); font-size: 11px; }
button:disabled { cursor: wait; opacity: .7; transform: none !important; }
@media (max-width: 760px) {
  .student-summary { grid-template-columns: repeat(2, 1fr); }
}

/* Manajemen user v3 */
.user-summary { grid-template-columns: repeat(4, 1fr); }
.action-secondary { color: #6d4a00; background: #fff3d8; }
.notice-box {
  margin: 0 20px 18px;
  padding: 13px 15px;
  border: 1px solid #cfe0f2;
  border-radius: 13px;
  color: #365773;
  background: #f1f7fd;
  font-size: 12px;
  line-height: 1.6;
}
.check-panel {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #cfdaea;
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  font-weight: 650;
}
.check-panel input { width: auto; margin: 0; }
.loading-state {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #d7e5f3;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .user-summary { grid-template-columns: repeat(2, 1fr); }
  .notice-box { margin-left: 12px; margin-right: 12px; }
}


/* ===== LAPORAN & RIWAYAT V3.3 ===== */
.report-page{align-items:stretch}.report-tabs{display:flex;gap:8px;flex-wrap:wrap;padding:8px;background:#fff;border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow-sm)}.report-tab{border:0;background:transparent;color:var(--muted);font-weight:800;padding:11px 16px;border-radius:11px;cursor:pointer}.report-tab:hover{background:#edf5fd;color:var(--primary)}.report-tab.active{background:var(--primary);color:#fff}.report-toolbar{align-items:flex-end}.report-paper{background:#fff;border:1px solid var(--border);border-radius:20px;box-shadow:var(--shadow-sm);padding:28px;color:#102747}.report-paper-header{display:flex;align-items:center;gap:18px;padding-bottom:18px;border-bottom:2px solid #164f8f}.report-logo{width:68px;height:68px;object-fit:contain}.report-school{font-size:.83rem;font-weight:900;letter-spacing:.05em;text-transform:uppercase;color:#31577e}.report-paper-header h2{font-size:1.45rem;margin:4px 0;color:#0e2c52}.report-paper-header p{margin:0;color:var(--muted)}.report-meta-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 18px;margin:20px 0}.report-meta-grid>div{display:grid;grid-template-columns:110px 1fr;gap:8px;padding:7px 0;border-bottom:1px dashed #c8d5e3}.report-meta-grid span{font-size:.75rem;color:var(--muted)}.report-meta-grid strong{font-size:.82rem;overflow-wrap:anywhere}.report-summary{grid-template-columns:repeat(auto-fit,minmax(130px,1fr));margin:0 0 22px}.report-section{margin-top:24px}.report-section h3{margin:0 0 9px;color:#123d70;font-size:1rem}.report-note{margin:0 0 10px;color:var(--muted);font-size:.75rem}.report-table{width:100%;min-width:860px;border-collapse:collapse;table-layout:auto;font-size:.76rem}.report-table th,.report-table td{border:1px solid #c8d5e3;padding:8px;vertical-align:top;line-height:1.4;overflow-wrap:anywhere}.report-table th{background:#eaf3fc;color:#153d68;font-size:.7rem;text-transform:uppercase;letter-spacing:.02em}.report-table tbody tr:nth-child(even){background:#f9fbfe}.report-empty{padding:45px 20px;border:1px dashed #aebfd2;border-radius:14px;color:var(--muted);text-align:center}.report-signature{display:grid;grid-template-columns:1fr minmax(240px,320px);gap:20px;margin-top:34px}.report-signature p{margin:3px 0}.signature-space{height:70px}.print-report{border:0;box-shadow:none;padding:0;border-radius:0}
@media(max-width:900px){.report-meta-grid{grid-template-columns:1fr 1fr}.report-paper{padding:20px}.report-toolbar{align-items:stretch}.report-toolbar .toolbar-group{width:100%}}
@media(max-width:620px){.report-tabs{display:grid;grid-template-columns:1fr 1fr}.report-tab{padding:10px 8px;font-size:.78rem}.report-meta-grid{grid-template-columns:1fr}.report-paper-header{align-items:flex-start}.report-logo{width:52px;height:52px}.report-paper-header h2{font-size:1.05rem}.report-signature{grid-template-columns:1fr}.report-signature>div:first-child{display:none}}

/* =========================================================
   V3.4.2 — Perbaikan navigasi tab Laporan & Riwayat
   Menjamin semua tab tetap terlihat, termasuk tab aktif.
   ========================================================= */
:root {
  --primary: #1f63ae;
  --primary-dark: #164f8f;
  --border: #dce6f2;
  --shadow-sm: 0 8px 24px rgba(18, 55, 96, .08);
}

.report-page .report-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  width: 100%;
  padding: 12px;
  overflow: visible;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fe 100%);
  border: 1px solid #d5e2f0;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(18, 55, 96, .08);
}

.report-page .report-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  min-height: 50px;
  padding: 11px 14px;
  border: 1px solid #cfe0f1;
  border-radius: 12px;
  background: #ffffff;
  color: #174b7f;
  font-size: .86rem;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  box-shadow: 0 3px 10px rgba(30, 91, 151, .06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.report-page .report-tab::before {
  display: inline-grid;
  place-items: center;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: #e8f3fd;
  color: #1d66ac;
  font-size: .9rem;
  font-weight: 900;
  content: "▤";
}

.report-page .report-tab[data-report-tab="journals"]::before { content: "▣"; }
.report-page .report-tab[data-report-tab="attendance"]::before { content: "✓"; }
.report-page .report-tab[data-report-tab="attendanceAll"]::before { content: "Σ"; }
.report-page .report-tab[data-report-tab="grades"]::before { content: "★"; }
.report-page .report-tab[data-report-tab="guidance"]::before { content: "●"; }

.report-page .report-tab:hover {
  transform: translateY(-1px);
  border-color: #77addd;
  background: #eef7ff;
  color: #103f72;
  box-shadow: 0 8px 18px rgba(31, 99, 174, .13);
}

.report-page .report-tab.active,
.report-page .report-tab[aria-selected="true"] {
  border-color: #1f63ae;
  background: linear-gradient(135deg, #164f8f 0%, #287dce 100%);
  color: #ffffff;
  box-shadow: 0 9px 20px rgba(31, 99, 174, .25);
}

.report-page .report-tab.active::before,
.report-page .report-tab[aria-selected="true"]::before {
  background: rgba(255, 255, 255, .20);
  color: #ffffff;
}

.report-page .report-tab:focus-visible {
  outline: 3px solid rgba(40, 125, 206, .25);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .report-page .report-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .report-page .report-tabs {
    grid-template-columns: 1fr;
    padding: 9px;
  }
  .report-page .report-tab {
    justify-content: flex-start;
    min-height: 46px;
    text-align: left;
  }
}
