/* ============================================================================
   Raport Mahasiswa — design system
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #060912;
  --bg-soft: #0a0f1f;
  --ink: #eef1fb;
  --ink-dim: #c3cbe4;
  --muted: #8d99ba;
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.06);

  --violet: #7c5cff;
  --indigo: #5b6cff;
  --cyan: #22d3ee;
  --emerald: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --slate: #94a3b8;

  --grad: linear-gradient(135deg, #7c5cff 0%, #5b6cff 45%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(34, 211, 238, 0.12));

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.9);
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(124, 92, 255, 0.35);
}

/* --- background ------------------------------------------------------------ */

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-orbs::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
  opacity: 0.14;
  mix-blend-mode: overlay;
}

.bg-orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: drift 22s ease-in-out infinite;
}

.bg-orbs span:nth-child(1) {
  width: 46vw;
  height: 46vw;
  top: -16vw;
  left: -10vw;
  background: radial-gradient(circle at 30% 30%, #6d4dff, transparent 65%);
}

.bg-orbs span:nth-child(2) {
  width: 40vw;
  height: 40vw;
  top: 30vh;
  right: -12vw;
  background: radial-gradient(circle at 50% 50%, #1291b8, transparent 66%);
  animation-delay: -7s;
}

.bg-orbs span:nth-child(3) {
  width: 34vw;
  height: 34vw;
  bottom: -14vw;
  left: 28vw;
  background: radial-gradient(circle at 50% 50%, #b0367a, transparent 68%);
  opacity: 0.32;
  animation-delay: -13s;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(2vw, -3vh, 0) scale(1.08);
  }
}

/* --- primitives ------------------------------------------------------------ */

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  pointer-events: none;
}

.card-pad {
  padding: 22px 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--grad);
  border-color: transparent;
  color: #0a0620;
  font-weight: 800;
  box-shadow: 0 12px 30px -12px rgba(124, 92, 255, 0.85);
}

.btn-primary:hover {
  background: var(--grad);
  filter: brightness(1.07);
  box-shadow: 0 16px 36px -12px rgba(124, 92, 255, 0.95);
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.input,
.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 9, 18, 0.55);
  color: var(--ink);
  font-size: 14.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field input:focus,
.field select:focus,
.input:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
  background: rgba(6, 9, 18, 0.8);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-dim);
  white-space: nowrap;
}

.badge-star {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}

.badge-good {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
}

.badge-fair {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
}

.badge-low {
  border-color: rgba(251, 113, 133, 0.32);
  background: rgba(251, 113, 133, 0.12);
  color: #fda4af;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- login ---------------------------------------------------------------- */

.auth {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
  padding: 6vh 6vw;
  border-right: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 17px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--grad);
  color: #08061a;
  box-shadow: 0 10px 26px -12px rgba(124, 92, 255, 0.9);
  flex: none;
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.auth-brand h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 4.4vw, 3.9rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.035em;
  max-width: 15ch;
}

.auth-brand h1 em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-brand > p {
  max-width: 46ch;
  color: var(--ink-dim);
  font-size: 15.5px;
}

.auth-points {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 44ch;
}

.auth-points li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink-dim);
}

.auth-points b {
  color: var(--ink);
  font-weight: 600;
}

.tick {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  margin-top: 2px;
  border-radius: 7px;
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
  font-size: 12px;
  flex: none;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 6vh 5vw;
}

.auth-card {
  padding: 30px 30px 26px;
  max-width: 400px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.auth-card h2 {
  font-size: 24px;
  margin-bottom: 4px;
}

.auth-card .sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.auth-card .btn {
  width: 100%;
  margin-top: 6px;
  padding: 13px 20px;
}

.auth-error {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.1);
  color: #fda4af;
  font-size: 13.5px;
}

.demo-accounts {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12.8px;
  color: var(--muted);
}

.demo-accounts b {
  color: var(--ink-dim);
}

.demo-accounts button {
  all: unset;
  cursor: pointer;
  color: #a5b4fc;
  font-weight: 600;
  border-bottom: 1px dotted rgba(165, 180, 252, 0.5);
}

.demo-accounts button:hover {
  color: #c7d2fe;
}

/* floating preview card */
.auth-preview {
  position: absolute;
  right: 3vw;
  bottom: 4vh;
  width: 240px;
  padding: 16px 18px;
  border-radius: 18px;
  transform: rotate(-3deg);
  animation: floaty 7s ease-in-out infinite;
}

.auth-preview .pv-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.auth-preview .pv-ips {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.auth-preview .pv-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.pv-bars {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 52px;
}

.pv-bars i {
  flex: 1;
  border-radius: 5px 5px 2px 2px;
  background: var(--grad);
  opacity: 0.85;
  animation: grow 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes floaty {
  0%,
  100% {
    transform: rotate(-3deg) translateY(0);
  }
  50% {
    transform: rotate(-3deg) translateY(-12px);
  }
}

@keyframes grow {
  from {
    transform: scaleY(0.05);
    transform-origin: bottom;
  }
}

/* --- app shell ------------------------------------------------------------ */

.app {
  position: relative;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(6, 9, 18, 0.72);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.topbar .spacer {
  flex: 1;
}

.top-nav {
  display: flex;
  gap: 4px;
}

.top-nav a {
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease;
}

.top-nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.top-nav a.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 5px 14px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--grad);
  color: #0a0620;
  font-weight: 800;
  font-size: 13px;
  flex: none;
}

.user-chip .uc-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.user-chip .uc-role {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
}

.view {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) clamp(16px, 4vw, 44px) 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.view > * {
  animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.view > *:nth-child(2) {
  animation-delay: 0.05s;
}
.view > *:nth-child(3) {
  animation-delay: 0.1s;
}
.view > *:nth-child(4) {
  animation-delay: 0.15s;
}
.view > *:nth-child(5) {
  animation-delay: 0.2s;
}
.view > *:nth-child(6) {
  animation-delay: 0.25s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* --- hero ----------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: clamp(24px, 3.4vw, 38px);
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  width: 46%;
  height: 160%;
  right: -12%;
  top: -30%;
  background: radial-gradient(circle at 50% 50%, rgba(124, 92, 255, 0.26), transparent 62%);
  pointer-events: none;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  margin: 10px 0 6px;
}

.hero-sub {
  color: var(--muted);
  font-size: 14.5px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-headline {
  margin-top: 18px;
  max-width: 62ch;
  font-size: 14.5px;
  color: var(--ink-dim);
  border-left: 2px solid rgba(124, 92, 255, 0.6);
  padding-left: 14px;
}

.hero-gauge {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(160px, 20vw, 208px);
  aspect-ratio: 1;
  flex: none;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-track {
  stroke: rgba(255, 255, 255, 0.08);
  fill: none;
  stroke-width: 11;
}

.gauge-fill {
  fill: none;
  stroke-width: 11;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 2px;
}

.gauge-value {
  font-family: var(--display);
  font-size: clamp(30px, 3.6vw, 42px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.gauge-label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- kpi ------------------------------------------------------------------ */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.16);
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  font-family: var(--display);
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.kpi-note {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.trend-up {
  color: #6ee7b7;
}
.trend-down {
  color: #fda4af;
}

/* --- grid & section ------------------------------------------------------- */

.grid-2 {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: stretch;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.grid-3.align-start {
  align-items: start;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
}

.section-head h3 {
  font-size: 16.5px;
}

.section-head p {
  font-size: 12.5px;
  color: var(--muted);
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-title h3 {
  font-size: 16px;
}

.card-title .hint {
  font-size: 12px;
  color: var(--muted);
}

/* --- radar / charts ------------------------------------------------------- */

.chart-wrap {
  display: grid;
  place-items: center;
}

.radar {
  width: 100%;
  max-width: 380px;
  height: auto;
  overflow: visible;
}

.radar-grid {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
}

.radar-spoke {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

.radar-shape {
  fill: url(#radarFill);
  stroke: url(#radarStroke);
  stroke-width: 2;
  animation: fadeIn 0.9s ease both;
}

.radar-dot {
  fill: #c4b5fd;
  stroke: #120b2c;
  stroke-width: 1.5;
}

.radar-label {
  fill: #a9b4d2;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
}

.radar-value {
  fill: #eef1fb;
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 700;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

/* bars */
.bars {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.bar-head .nm {
  color: var(--ink-dim);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-head .vl {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}

.bar-track {
  height: 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 99px;
  width: 0;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-fill.excellent {
  background: linear-gradient(90deg, #34d399, #6ee7b7);
}
.bar-fill.good {
  background: linear-gradient(90deg, #22d3ee, #60a5fa);
}
.bar-fill.fair {
  background: linear-gradient(90deg, #fbbf24, #fcd34d);
}
.bar-fill.low {
  background: linear-gradient(90deg, #fb923c, #fb7185);
}
.bar-fill.critical {
  background: linear-gradient(90deg, #fb7185, #f43f5e);
}
.bar-fill.empty {
  background: rgba(255, 255, 255, 0.12);
}

/* line chart */
.line-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.lc-grid {
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.lc-area {
  fill: url(#lcFill);
}

.lc-line {
  fill: none;
  stroke: url(#lcStroke);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.lc-dot {
  fill: #0a0f1f;
  stroke: #22d3ee;
  stroke-width: 2.4;
}

.lc-dot.current {
  fill: #7c5cff;
  stroke: #c4b5fd;
  r: 5.5;
}

.lc-label {
  fill: #8d99ba;
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 600;
}

.lc-value {
  fill: #eef1fb;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
}

/* donut */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
}

.donut {
  width: 168px;
  height: 168px;
  transform: rotate(-90deg);
}

.donut circle {
  fill: none;
  stroke-width: 16;
}

.donut-legend {
  display: grid;
  gap: 8px;
  font-size: 13px;
  min-width: 150px;
}

.donut-legend .lg {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: space-between;
}

.donut-legend .lg span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-dim);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: none;
}

.donut-legend b {
  font-variant-numeric: tabular-nums;
}

/* --- insights ------------------------------------------------------------- */

.insight {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.insight h4 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  letter-spacing: 0;
}

.icon-pill {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  flex: none;
  font-size: 14px;
}

.icon-pill.up {
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}
.icon-pill.down {
  background: rgba(251, 113, 133, 0.13);
  border: 1px solid rgba(251, 113, 133, 0.3);
  color: #fda4af;
}
.icon-pill.bulb {
  background: rgba(124, 92, 255, 0.16);
  border: 1px solid rgba(124, 92, 255, 0.34);
  color: #c4b5fd;
}

.mini-list {
  display: grid;
  gap: 9px;
}

.mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
}

.mini-item .mi-name {
  flex: 1;
  min-width: 0;
  font-size: 12.8px;
  font-weight: 600;
  color: var(--ink-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-item .mi-score {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 13px;
}

.letter {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 26px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.letter.excellent {
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
}
.letter.good {
  background: rgba(34, 211, 238, 0.14);
  color: #67e8f9;
}
.letter.fair {
  background: rgba(251, 191, 36, 0.14);
  color: #fcd34d;
}
.letter.low {
  background: rgba(251, 146, 60, 0.15);
  color: #fdba74;
}
.letter.critical {
  background: rgba(251, 113, 133, 0.15);
  color: #fda4af;
}
.letter.empty {
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.rec-list {
  display: grid;
  gap: 10px;
}

.rec {
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
}

.rec-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}

.rec-top b {
  font-size: 13px;
}

.rec-top .metric {
  font-size: 11.5px;
  font-weight: 700;
  color: #c4b5fd;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.14);
  white-space: nowrap;
}

.rec p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* --- table ---------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  margin: 0 -6px;
  padding: 0 6px;
}

table.grade {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-size: 13.5px;
}

table.grade thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 8px;
  white-space: nowrap;
}

table.grade tbody tr {
  background: rgba(255, 255, 255, 0.028);
  transition: background 0.15s ease;
}

table.grade tbody tr:hover {
  background: rgba(255, 255, 255, 0.055);
}

table.grade td {
  padding: 12px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

table.grade td:first-child {
  border-left: 1px solid var(--line-soft);
  border-radius: 12px 0 0 12px;
}

table.grade td:last-child {
  border-right: 1px solid var(--line-soft);
  border-radius: 0 12px 12px 0;
}

table.grade .c-kode {
  font-weight: 700;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.grade .c-nama {
  font-weight: 600;
}

table.grade .c-sub {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

table.grade .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.grade tfoot td {
  padding: 12px;
  font-weight: 800;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink);
}

.chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11.5px;
  color: var(--ink-dim);
  white-space: nowrap;
}

/* --- certificate cta ------------------------------------------------------ */

.cert-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 26px 30px;
  overflow: hidden;
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.16), rgba(34, 211, 238, 0.08) 55%, rgba(255, 255, 255, 0.02));
}

.cert-cta h3 {
  font-family: var(--display);
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  font-weight: 600;
  margin-bottom: 6px;
}

.cert-cta p {
  font-size: 13.5px;
  color: var(--ink-dim);
  max-width: 62ch;
}

.cert-cta .actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* --- certificate sheet ---------------------------------------------------- */

.cert-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(3, 5, 12, 0.9);
  backdrop-filter: blur(8px);
  padding: 18px;
  overflow: auto;
}

.cert-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding-bottom: 14px;
}

.cert-toolbar .hint {
  margin-right: auto;
  font-size: 13px;
  color: var(--muted);
}

.cert-stage {
  display: grid;
  place-items: center;
  padding-bottom: 24px;
}

.cert-sheet {
  width: min(1120px, 100%);
  aspect-ratio: 297 / 210;
  background: #fbf7ee;
  color: #1b2338;
  position: relative;
  overflow: hidden;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.85);
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
}

.cert-sheet::before {
  content: '';
  position: absolute;
  inset: 14px;
  border: 2px solid #c2a15c;
  pointer-events: none;
}

.cert-sheet::after {
  content: '';
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(194, 161, 92, 0.5);
  pointer-events: none;
}

.cert-inner {
  position: absolute;
  inset: 0;
  padding: 54px 70px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 0;
}

.cert-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0.05;
  pointer-events: none;
}

.cert-mark svg {
  width: 46%;
}

.cert-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.cert-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b5a34;
}

.cert-brand .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.cert-no {
  font-family: var(--font);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a7c5e;
  text-align: right;
  line-height: 1.7;
}

.cert-head {
  text-align: center;
  margin-top: 22px;
}

.cert-head .kicker {
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: #a08b5c;
  font-weight: 700;
}

.cert-head h2 {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1b2338;
  margin: 8px 0 6px;
  line-height: 1;
}

.cert-head .rule {
  width: 130px;
  height: 2px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, #c2a15c, transparent);
}

.cert-body {
  text-align: center;
  margin-top: 20px;
}

.cert-body .given {
  font-family: var(--font);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #8a7c5e;
  font-weight: 700;
}

.cert-name {
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 6px 0 2px;
  color: #16203a;
}

.cert-name-line {
  width: min(420px, 70%);
  margin: 6px auto 14px;
  border-bottom: 1px solid rgba(107, 90, 52, 0.35);
}

.cert-text {
  max-width: 62ch;
  margin: 0 auto;
  font-size: clamp(12px, 1.35vw, 14.5px);
  line-height: 1.75;
  color: #3a4460;
}

.cert-text b {
  color: #1b2338;
  font-weight: 700;
}

.cert-stats {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin-top: 20px;
  font-family: var(--font);
}

.cert-stats div {
  text-align: center;
}

.cert-stats .cs-value {
  font-family: var(--display);
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 700;
  color: #1b2338;
  line-height: 1.1;
}

.cert-stats .cs-label {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a7c5e;
  font-weight: 700;
}

.cert-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: auto;
}

.cert-sign {
  text-align: center;
  font-family: var(--font);
  min-width: 210px;
}

.cert-sign .sign-name {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  color: #1b2338;
  border-bottom: 1px solid rgba(107, 90, 52, 0.4);
  padding-bottom: 4px;
  margin-bottom: 5px;
}

.cert-sign .sign-role {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a7c5e;
  font-weight: 700;
}

.cert-date {
  font-family: var(--font);
  font-size: 11px;
  color: #6b5a34;
  text-align: center;
  line-height: 1.7;
}

.cert-seal {
  position: relative;
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  flex: none;
}

.cert-seal .seal-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #b99a58;
  box-shadow: inset 0 0 0 5px #fbf7ee, inset 0 0 0 6px rgba(185, 154, 88, 0.55);
}

.cert-seal .seal-core {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #e8cf95, #c2a15c 62%, #9a7c3f);
  display: grid;
  place-items: center;
  color: #3d3015;
  font-family: var(--font);
  font-weight: 800;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-align: center;
  line-height: 1.35;
  text-transform: uppercase;
}

.cert-ribbon {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 22px;
  background: #b99a58;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 70%, 0 100%);
}

/* --- toast / dialog ------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  z-index: 200;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(14, 19, 34, 0.96);
  box-shadow: 0 20px 50px -20px #000;
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.err {
  border-color: rgba(251, 113, 133, 0.45);
  color: #fda4af;
}

.toast.ok {
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #0b1020;
  color: var(--ink);
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
}

dialog::backdrop {
  background: rgba(3, 5, 12, 0.7);
  backdrop-filter: blur(6px);
}

.dialog-pad {
  padding: 24px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.dialog-head h3 {
  font-size: 18px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.close-x {
  all: unset;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
}

.close-x:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

/* --- admin ---------------------------------------------------------------- */

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(6, 9, 18, 0.6);
  font-size: 13.5px;
}

.search input:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.14);
}

.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--muted);
}

table.admin {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-size: 13.5px;
}

table.admin thead th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 8px;
  white-space: nowrap;
}

table.admin tbody tr {
  background: rgba(255, 255, 255, 0.028);
  transition: background 0.15s ease;
}

table.admin tbody tr:hover {
  background: rgba(255, 255, 255, 0.055);
}

table.admin td {
  padding: 12px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  white-space: nowrap;
}

table.admin td:first-child {
  border-left: 1px solid var(--line-soft);
  border-radius: 12px 0 0 12px;
}
table.admin td:last-child {
  border-right: 1px solid var(--line-soft);
  border-radius: 0 12px 12px 0;
}

.student-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.student-cell .nm {
  font-weight: 700;
  line-height: 1.3;
}

.student-cell .sub {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.3;
}

.ips-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}

.ips-pill.star {
  background: rgba(251, 191, 36, 0.14);
  color: #fcd34d;
}
.ips-pill.great {
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
}
.ips-pill.good {
  background: rgba(34, 211, 238, 0.14);
  color: #67e8f9;
}
.ips-pill.fair {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}
.ips-pill.low {
  background: rgba(251, 113, 133, 0.14);
  color: #fda4af;
}

.grade-editor {
  display: grid;
  gap: 8px;
  max-height: 46vh;
  overflow: auto;
  padding-right: 4px;
}

.ge-row {
  display: grid;
  grid-template-columns: 1fr 78px 46px;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.028);
}

.ge-row .ge-nm {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ge-row .ge-nm small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.ge-row input {
  width: 100%;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(6, 9, 18, 0.7);
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13.5px;
}

.ge-row input:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  width: fit-content;
}

.tab {
  padding: 7px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.15s ease;
}

.tab.active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

/* --- skeleton ------------------------------------------------------------- */

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 14px;
  text-align: center;
}

.loader {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.12);
  border-top-color: #7c5cff;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- footer --------------------------------------------------------------- */

.site-foot {
  margin-top: auto;
  padding: 26px clamp(16px, 4vw, 44px);
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 1040px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .kpi-row,
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-brand {
    padding: 44px 24px 10px;
    border-right: none;
  }
  .auth-brand h1 {
    font-size: clamp(2rem, 7vw, 2.8rem);
  }
  .auth-panel {
    padding: 24px 24px 56px;
  }
  .auth-preview {
    display: none !important;
  }
}

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .hero-gauge {
    margin: 0 auto;
  }
  .cert-cta {
    grid-template-columns: 1fr;
  }
  .top-nav {
    display: none;
  }
  .view {
    gap: 14px;
  }
  .cert-inner {
    padding: 26px 24px;
  }
  .cert-stats {
    gap: 18px;
  }
  .cert-sign {
    min-width: 140px;
  }
  .cert-seal {
    width: 76px;
    height: 76px;
  }
  .cert-seal .seal-core {
    width: 54px;
    height: 54px;
    font-size: 7px;
  }
  table.admin td,
  table.admin th {
    padding: 10px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- print: hanya lembar sertifikat -------------------------------------- */

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  html,
  body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body > *:not(.cert-overlay) {
    display: none !important;
  }

  .bg-orbs {
    display: none !important;
  }

  .cert-overlay {
    position: static !important;
    inset: auto !important;
    display: block !important;
    background: #fff !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    overflow: visible !important;
    height: auto !important;
  }

  .cert-toolbar {
    display: none !important;
  }

  .cert-stage {
    display: block !important;
    padding: 0 !important;
  }

  .cert-sheet {
    width: 297mm !important;
    height: 210mm !important;
    aspect-ratio: auto !important;
    box-shadow: none !important;
    margin: 0 !important;
    page-break-after: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
