:root {
  color-scheme: light;
  --bg: #fff6fa;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-solid: #ffffff;
  --surface-rose: #fff0f6;
  --rose-25: #fff7fb;
  --rose-50: #fff0f6;
  --rose-100: #ffe1ed;
  --rose-200: #ffc4db;
  --rose-300: #f7a7c7;
  --rose-400: #ee7eab;
  --rose-500: #e85d95;
  --rose-600: #d83a7e;
  --plum-900: #24151f;
  --plum-700: #563546;
  --plum-500: #8a6a7a;
  --line: rgba(232, 93, 149, 0.18);
  --shadow-soft: 0 24px 70px rgba(177, 87, 124, 0.16);
  --shadow-card: 0 16px 42px rgba(176, 80, 119, 0.1);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --font-ui: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-logo: "Rajdhani", "Sora", "Inter", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 11% 7%, rgba(255, 194, 219, 0.95) 0, transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(255, 231, 241, 0.95) 0, transparent 34%),
    linear-gradient(135deg, #fff0f6 0%, #fffafb 52%, #f8f4ff 100%);
  color: var(--plum-900);
  font-family: var(--font-ui);
}

button,
input,
output {
  font: inherit;
}

.page-glow {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.72;
  pointer-events: none;
}

.page-glow-one {
  width: 280px;
  height: 280px;
  left: -70px;
  top: 80px;
  background: rgba(255, 184, 211, 0.55);
}

.page-glow-two {
  width: 340px;
  height: 340px;
  right: -90px;
  bottom: -80px;
  background: rgba(244, 209, 229, 0.68);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  width: min(1280px, calc(100% - 32px));
  margin: 28px auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px);
}

.sidebar {
  min-width: 0;
  min-height: calc(100vh - 56px);
  padding: 36px 24px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 244, 249, 0.92), rgba(255, 255, 255, 0.68)),
    radial-gradient(circle at 30% 0%, rgba(255, 197, 220, 0.65), transparent 42%);
}

.brand-block {
  margin-bottom: 30px;
  text-align: center;
}

.brand-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--rose-500);
  font-family: var(--font-logo);
  font-size: clamp(48px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 0.85;
  text-decoration: none;
  text-shadow: 0 10px 24px rgba(232, 93, 149, 0.12);
  text-transform: uppercase;
}

.brand-spark {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--rose-500);
  box-shadow:
    16px 9px 0 -2px var(--rose-300),
    -17px 11px 0 -3px var(--rose-300);
  transform: translateX(-50%) rotate(45deg);
}

.brand-kicker {
  margin: 10px 0 0;
  color: var(--rose-600);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel-card,
.metric-card,
.info-card,
.semester-card,
.distribution-card,
.table-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
}

.panel-card {
  padding: 22px;
  border-radius: var(--radius-lg);
}

.panel-card + .panel-card {
  margin-top: 20px;
}

.section-eyebrow {
  display: inline-block;
  color: var(--rose-600);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

.upload-card h2 {
  margin: 10px 0 6px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0;
}

.muted {
  margin: 0 0 18px;
  color: var(--plum-500);
  font-size: 14px;
  line-height: 1.5;
}

.drop-zone {
  display: grid;
  min-height: 190px;
  padding: 24px;
  place-items: center;
  border: 1.5px dashed rgba(232, 93, 149, 0.48);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 246, 250, 0.85));
  cursor: pointer;
  text-align: center;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--rose-500);
  background: #fff8fb;
  box-shadow: 0 16px 32px rgba(232, 93, 149, 0.12);
  transform: translateY(-2px);
}

.upload-icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 20px;
  background: var(--rose-50);
  color: var(--rose-500);
}

.upload-icon svg {
  width: 38px;
  height: 38px;
}

.drop-title {
  display: block;
  max-width: 100%;
  color: var(--plum-900);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.drop-subtitle {
  display: block;
  max-width: 100%;
  margin-top: 5px;
  color: var(--plum-500);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(232, 93, 149, 0.14);
  border-radius: 18px;
  background: rgba(255, 240, 246, 0.74);
}

.file-badge {
  display: grid;
  width: 44px;
  height: 52px;
  place-items: center;
  border: 2px solid var(--rose-300);
  border-radius: 12px;
  background: #fff;
  color: var(--rose-600);
  font-size: 12px;
  font-weight: 900;
}

.file-preview strong,
.file-preview span {
  display: block;
  overflow-wrap: anywhere;
}

.file-preview strong {
  font-size: 14px;
}

.file-preview span {
  margin-top: 3px;
  color: var(--plum-500);
  font-size: 13px;
}

.privacy-note {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  color: var(--plum-500);
}

.privacy-note span {
  flex: 0 0 auto;
  color: var(--rose-500);
}

.privacy-note svg {
  width: 20px;
  height: 20px;
}

.privacy-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.formula-card {
  display: flex;
  gap: 14px;
  background: linear-gradient(135deg, rgba(255, 241, 247, 0.98), rgba(255, 250, 252, 0.78));
}

.formula-icon {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 15px;
  background: #fff;
  color: var(--rose-500);
  box-shadow: 0 10px 24px rgba(232, 93, 149, 0.1);
}

.formula-icon svg {
  width: 22px;
  height: 22px;
}

.formula-card p {
  margin: 12px 0 0;
  color: var(--plum-700);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}

.content-area {
  min-width: 0;
  padding: 46px 36px 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.page-label {
  margin: 0;
  color: var(--plum-500);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  gap: 9px;
  border: 1px solid rgba(232, 93, 149, 0.28);
  border-radius: 999px;
  background: linear-gradient(135deg, #fff 0%, var(--rose-50) 100%);
  color: var(--rose-600);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(232, 93, 149, 0.12);
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.export-button svg {
  width: 18px;
  height: 18px;
}

.export-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #fff7fb 0%, #ffe2ef 100%);
  box-shadow: 0 16px 32px rgba(232, 93, 149, 0.18);
  transform: translateY(-1px);
}

.export-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 9px;
  padding: 12px 16px;
  border: 1px solid rgba(232, 93, 149, 0.23);
  border-radius: 999px;
  background: rgba(255, 244, 249, 0.88);
  color: var(--rose-600);
  font-size: 13px;
  font-weight: 800;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--rose-500);
  box-shadow: 0 0 0 5px rgba(232, 93, 149, 0.11);
}

.status-chip.is-loading .status-dot {
  animation: pulse 900ms ease-in-out infinite;
}

.status-chip.is-error {
  color: #a6325f;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.55fr) repeat(3, minmax(120px, 0.7fr));
  gap: 16px;
}

.average-card {
  position: relative;
  min-height: 196px;
  overflow: hidden;
  padding: 28px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.34), transparent 18%),
    linear-gradient(135deg, #ff93bb 0%, #ec5d98 52%, #cc3978 100%);
  color: #fff;
  box-shadow: 0 26px 56px rgba(220, 72, 132, 0.28);
}

.average-card::before,
.average-card::after {
  position: absolute;
  border-radius: 999px;
  content: "";
  pointer-events: none;
}

.average-card::before {
  right: -74px;
  bottom: -124px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.average-card::after {
  right: 42px;
  top: 52px;
  width: 160px;
  height: 160px;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(4px);
}

.average-card > * {
  position: relative;
  z-index: 1;
}

.average-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.mini-pill {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.average-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(68px, 8vw, 104px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.86;
}

.average-card p {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  font-weight: 600;
}

.metric-card {
  position: relative;
  min-height: 196px;
  overflow: hidden;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
}

.metric-card::after {
  position: absolute;
  right: -28px;
  bottom: -28px;
  width: 90px;
  height: 90px;
  border-radius: 999px;
  background: rgba(255, 224, 238, 0.88);
  content: "";
}

.metric-label {
  display: block;
  color: var(--plum-500);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 22px;
  font-family: var(--font-display);
  font-size: 38px;
  letter-spacing: 0;
}

.metric-icon {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 17px;
  background: var(--rose-50);
  color: var(--rose-600);
  font-size: 25px;
  font-weight: 800;
}

.metric-icon svg {
  width: 22px;
  height: 22px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.15fr 0.75fr;
  gap: 16px;
  margin-top: 16px;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 92px;
  padding: 18px;
  border-radius: 22px;
}

.info-icon {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 15px;
  background: var(--rose-50);
  color: var(--rose-600);
}

.info-icon svg {
  width: 22px;
  height: 22px;
}

.info-card span:not(.info-icon) {
  display: block;
  color: var(--plum-500);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.info-card strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
}

.section-block {
  margin-top: 28px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.heading-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 10px;
  background: var(--rose-50);
  color: var(--rose-600);
  font-weight: 900;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0;
}

.carousel-controls {
  display: inline-flex;
  gap: 8px;
}

.carousel-controls button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--rose-600);
  cursor: pointer;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.carousel-controls button:hover {
  background: var(--rose-50);
  transform: translateY(-1px);
}

.semester-carousel {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--rose-300) transparent;
}

.semester-carousel::after {
  position: sticky;
  right: 0;
  display: block;
  width: 44px;
  height: 0;
  margin-left: auto;
  box-shadow: -28px -80px 42px 18px rgba(255, 250, 252, 0.9);
  content: "";
  pointer-events: none;
}

.semester-carousel::-webkit-scrollbar {
  height: 8px;
}

.semester-carousel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--rose-300);
}

.semester-grid {
  display: flex;
  gap: 16px;
  padding: 2px 2px 12px;
}

.semester-card {
  position: relative;
  flex: 0 0 clamp(220px, 28vw, 260px);
  min-height: 148px;
  overflow: hidden;
  padding: 19px 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.semester-card:hover {
  box-shadow: 0 18px 42px rgba(232, 93, 149, 0.14);
  transform: translateY(-3px);
}

.semester-card::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 12%, rgba(255, 225, 237, 0.82), transparent 34%);
  content: "";
  pointer-events: none;
}

.semester-card > * {
  position: relative;
}

.semester-icon {
  display: grid;
  width: 40px;
  height: 40px;
  margin-bottom: 15px;
  place-items: center;
  border-radius: 15px;
  background: var(--rose-50);
  color: var(--rose-600);
  font-size: 13px;
  font-weight: 900;
}

.semester-title {
  display: block;
  color: var(--plum-700);
  font-size: 13px;
  font-weight: 800;
}

.semester-average {
  display: block;
  margin-top: 5px;
  color: var(--rose-600);
  font-family: var(--font-display);
  font-size: 33px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.semester-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
  color: var(--plum-500);
  font-size: 12px;
  font-weight: 700;
}

.semester-meta span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 240, 246, 0.72);
}

.distribution-card,
.table-card {
  padding: 22px;
  border-radius: 26px;
}

.distribution-list {
  display: grid;
  gap: 14px;
}

.dist-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 14px;
}

.dist-label,
.dist-value {
  color: var(--plum-700);
  font-size: 13px;
  font-weight: 800;
}

.dist-value {
  text-align: right;
}

.dist-track {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #f7e9f0;
}

.dist-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose-300), var(--rose-500));
  box-shadow: 0 7px 14px rgba(232, 93, 149, 0.14);
}

.table-heading {
  align-items: flex-end;
}

.table-heading p {
  margin: 0;
  color: var(--plum-500);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid rgba(232, 93, 149, 0.12);
  text-align: left;
}

th {
  background: var(--rose-50);
  color: var(--plum-700);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: var(--plum-700);
  font-size: 14px;
}

tr:last-child td {
  border-bottom: 0;
}

.sem-pill,
.grade-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--rose-50);
  color: var(--rose-600);
  font-weight: 900;
}

.grade-pill {
  min-width: 48px;
  background: #ffe4ef;
}

.empty-row {
  color: var(--plum-500);
}

.table-action {
  display: block;
  margin: 16px auto 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--rose-600);
  cursor: pointer;
  font-weight: 900;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.table-action:hover {
  background: var(--rose-50);
  transform: translateY(-1px);
}

[hidden] {
  display: none !important;
}

@keyframes pulse {
  50% {
    transform: scale(0.7);
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .average-card {
    grid-column: 1 / -1;
  }

  .semester-grid {
    display: flex;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1280px);
    margin: 10px auto;
    border-radius: 24px;
  }

  .sidebar,
  .content-area {
    padding: 26px 18px;
  }

  .topbar,
  .section-heading,
  .table-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .carousel-heading {
    flex-direction: row;
    align-items: center;
  }

  .semester-card {
    flex-basis: min(82vw, 260px);
  }

  .status-chip {
    max-width: 100%;
    white-space: normal;
  }

  .topbar-actions,
  .export-button {
    width: 100%;
  }

  .metric-card {
    min-height: 132px;
  }

  .dist-row {
    grid-template-columns: 62px minmax(0, 1fr) 68px;
    gap: 10px;
  }

  .table-heading p {
    text-align: left;
  }

  table {
    min-width: 0;
    table-layout: fixed;
  }

  th,
  td {
    padding: 11px 8px;
    font-size: 11px;
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 42px;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 52px;
  }

  th:nth-child(4),
  td:nth-child(4) {
    width: 62px;
  }

  td:nth-child(3) {
    overflow-wrap: anywhere;
  }

  .sem-pill {
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
  }

  .grade-pill {
    min-width: 38px;
    height: 24px;
    padding: 0 8px;
  }
}
