.portal-card {
  background: white;
  border: 1px solid #e7eaf0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 2px 8px #172b4d08;
}
.portal-card h1,
.portal-card h2 {
  margin: 0 0 18px;
  font-size: 1.4rem;
  color: #243449;
}
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.portal-card label {
  display: block;
  font-weight: 600;
  margin: 12px 0 6px;
}
.portal-card input,
.portal-card select,
.portal-card textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
}
.portal-card textarea {
  min-height: 100px;
}
.portal-button {
  display: inline-block;
  background: #981b4d;
  color: white !important;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  margin: 8px 8px 8px 0;
  cursor: pointer;
  text-decoration: none;
}
.portal-button.secondary {
  background: #981b4d;
}
.portal-button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.portal-table {
  width: 100%;
  border-collapse: collapse;
}
.portal-table th,
.portal-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
.portal-table th {
  background: #f5f7fa;
  color: #334155;
}
.portal-scroll {
  overflow-x: auto;
}
.portal-muted {
  color: #64748b;
}
.portal-error,
#portal-status.error {
  color: #a3192b;
  background: #fff1f2;
  padding: 12px;
  border-radius: 6px;
}
#portal-status:empty {
  display: none;
}
.portal-success {
  color: #176540;
}
.portal-badge {
  border-radius: 20px;
  background: #edf2f7;
  padding: 4px 10px;
  white-space: nowrap;
}
.portal-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.portal-notice {
  font-size: 0.85rem;
  padding: 10px;
  color: #64748b;
}
.portal-card details {
  margin: 16px 0;
}
.portal-card summary {
  cursor: pointer;
  font-weight: 600;
}
.portal-card pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.portal-card .portal-check {
  width: auto;
}
.portal-card button.danger {
  background: #9f1239;
}
body.portal-loading .student-profile-card {
  visibility: hidden;
}
@media (max-width: 600px) {
  .portal-card {
    padding: 16px;
  }
  .portal-table td,
  .portal-table th {
    padding: 8px;
    font-size: 0.85rem;
  }
  .portal-grid {
    grid-template-columns: 1fr;
  }
}
@media print {
  .left-sidebar,
  .app-header,
  .portal-tools,
  button,
  .dashboard-footer {
    display: none !important;
  }
  .body-wrapper {
    margin: 0 !important;
  }
  .portal-card {
    box-shadow: none;
  }
}

/* Keep new actions in the original portal burgundy palette. */
.portal-button:hover,
.portal-button.secondary:hover {
  background: #7d163f;
}
.portal-button:focus-visible {
  outline: 2px solid #981b4d;
  outline-offset: 3px;
}
.academic-tools {
  margin: 0 0 20px;
  gap: 12px;
}
.academic-tools label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #002f63;
}
.academic-tools select {
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid #dfe3e8;
  border-radius: 6px;
  background: #fff;
  color: #002f63;
  font: inherit;
}
.academic-tools .portal-button {
  align-self: flex-end;
  margin: 0;
}
.transcript-body .semester-title-wrapper:not(:first-child) {
  margin-top: 30px;
}
.dashboard-content .table .table tr.gradeFail td {
  background: #ffebee;
}
.dashboard-content .table .table tr.gradeExempt td {
  background: #e3f2fd;
}
.dashboard-content .table .table tr.gradeCanceled td {
  background: #f5f5f5;
}
/* Preserve the icon-only desktop navigation on the original course layout. */
@media (max-width: 600px) {
  .academic-tools {
    align-items: stretch;
  }
  .academic-tools label {
    width: 100%;
  }
  .academic-tools select {
    width: 100%;
    min-width: 0;
  }
}
