.gpa-btn {
  background: #16253f;
  border: 1px solid #1e3a5f;
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
}
.gpa-btn:hover { background: #1e3a5f; }
.gpa-btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.gpa-btn-primary:hover { background: #1d4ed8; }
.gpa-btn-danger { background: #7f1d1d; border-color: #991b1b; color: #fca5a5; }
.gpa-btn-danger:hover { background: #991b1b; }

.topbar {
  display: flex !important;
  align-items: center !important;
  padding: 14px 24px !important;
  gap: 8px;
}
.topbar-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px;
  margin-left: auto;
}

.gpa-layout {
  display: flex;
  gap: 16px;
}
.gpa-left { flex: 1; min-width: 0; }
.gpa-right { width: 230px; flex-shrink: 0; }

/* SEMESTER TABS */
.sem-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.sem-tab {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  border: 1px solid #16253f;
  color: #7d8ca3;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sem-tab.active { background: #2563eb22; border-color: #2563eb; color: #7eb3f7; }
.sem-tab-del {
  font-size: 11px;
  color: #7d8ca3;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.sem-tab-del:hover { color: #ef4444; }

/* TABLE */
.table-wrap {
  background: #0b1729;
  border: 1px solid #16253f;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}
.table-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 50px;
  background: #0d1f38;
  border-bottom: 1px solid #16253f;
}
.th {
  padding: 8px 12px;
  font-size: 10px;
  color: #7d8ca3;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 50px;
  border-bottom: 1px solid #16253f;
}
.table-row:last-child { border-bottom: none; }
.td {
  padding: 6px 10px;
  display: flex;
  align-items: center;
}
.td input, .td select {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 4px 7px;
  color: #cbd5e1;
  font-size: 11px;
  width: 100%;
  outline: none;
}
.td input:focus, .td select:focus {
  border-color: #2563eb;
  background: #16253f;
}
.td select option { background: #0b1729; }
.del-btn {
  background: none;
  border: none;
  color: #7d8ca3;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  width: 100%;
}
.del-btn:hover { color: #ef4444; background: #3d1a0f; }
.add-row {
  padding: 8px 12px;
  font-size: 11px;
  color: #7d8ca3;
  cursor: pointer;
  border-top: 1px solid #16253f;
}
.add-row:hover { color: #7eb3f7; }

/* RESULTS */
.result-card {
  background: #0b1729;
  border: 1px solid #16253f;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.result-title {
  font-size: 10px;
  color: #7d8ca3;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.cgpa-big {
  font-size: 38px;
  font-weight: 700;
  color: #22c55e;
  text-align: center;
  margin: 6px 0 2px;
}
.cgpa-label {
  font-size: 10px;
  color: #7d8ca3;
  text-align: center;
  margin-bottom: 10px;
}
.cgpa-bar {
  background: #16253f;
  border-radius: 10px;
  height: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}
.cgpa-fill {
  height: 100%;
  border-radius: 10px;
  background: #22c55e;
  transition: width 0.4s ease;
}
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #16253f;
  font-size: 11px;
}
.result-row:last-child { border-bottom: none; }
.result-lbl { color: #7d8ca3; }
.result-val { color: #fff; font-weight: 500; }

/* GRADE DIST */
.dist-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.dist-lbl { font-size: 10px; color: #7d8ca3; width: 20px; text-align: right; }
.dist-bar-wrap { flex: 1; background: #16253f; border-radius: 4px; height: 6px; overflow: hidden; }
.dist-bar { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.dist-count { font-size: 10px; color: #7d8ca3; width: 14px; text-align: right; }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 24px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: #0b1729;
  border: 1px solid #16253f;
  border-radius: 12px;
  padding: 20px;
  width: 420px;
  max-width: calc(100vw - 48px);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.modal-close {
  background: none;
  border: none;
  color: #7d8ca3;
  font-size: 18px;
  cursor: pointer;
}
.modal-close:hover { color: #fff; }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-label { color: #7d8ca3; font-size: 11px; }
.form-input {
  background: #16253f;
  border: 1px solid #1e3a5f;
  border-radius: 6px;
  padding: 7px 10px;
  color: #cbd5e1;
  font-size: 12px;
  width: 100%;
  outline: none;
}
.form-input:focus { border-color: #2563eb; }
.form-input option { background: #0b1729; }
.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

@media (max-width: 767px) {
  .gpa-layout { flex-direction: column; }
  .gpa-right { width: 100%; }
}