:root {
  --ink: #172033;
  --muted: #64748b;
  --line: #dce4ef;
  --blue: #2563eb;
  --blue-dark: #174db7;
  --blue-soft: #eaf2ff;
  --green: #0f8a5f;
  --green-soft: #e9f8f1;
  --surface: #fff;
  --background: #f4f7fb;
}
* {
  box-sizing: border-box;
  letter-spacing: 0;
}
body.portal-page {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.portal-header {
  height: 76px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 30;
}
.portal-header-inner {
  width: min(94%, 1440px);
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.portal-brand img {
  width: 48px;
  height: 48px;
}
.portal-brand strong {
  display: block;
  font-size: 20px;
}
.portal-brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
.portal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.portal-btn {
  min-height: 42px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #263650;
  border-radius: 8px;
  padding: 0 15px;
  font-weight: 800;
}
.portal-btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.portal-btn.danger {
  color: #b42318;
  border-color: #efc1bc;
  background: #fff;
}
.portal-shell {
  width: min(94%, 1440px);
  margin: 28px auto 52px;
}
.portal-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 2px 24px;
  border-bottom: 1px solid var(--line);
}
.portal-eyebrow {
  color: var(--blue);
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 8px;
}
.portal-intro h1 {
  font-size: 34px;
  line-height: 1.25;
  margin: 0;
}
.portal-intro p {
  color: var(--muted);
  line-height: 1.65;
  margin: 8px 0 0;
}
.portal-identity {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.portal-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: #1558b0;
  font-size: 13px;
  font-weight: 800;
}
.portal-chip.green {
  background: var(--green-soft);
  color: var(--green);
}
.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}
.portal-main {
  display: grid;
  gap: 22px;
}
.portal-side {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 98px;
}
.portal-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  min-width: 0;
}
.portal-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.portal-section h2 {
  font-size: 21px;
  margin: 0;
}
.portal-section-head p {
  color: var(--muted);
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.55;
}
.portal-link {
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 800;
  padding: 3px;
  white-space: nowrap;
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.action-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  text-align: left;
  min-height: 128px;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.15s;
}
.action-item:hover {
  border-color: #8bb2ee;
  background: #f8fbff;
  transform: translateY(-2px);
}
.action-item.featured {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.action-index {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
  margin-bottom: 17px;
}
.featured .action-index {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.action-item strong {
  display: block;
  font-size: 17px;
  margin-bottom: 6px;
}
.action-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.featured span {
  color: #dbeafe;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.metric {
  background: #fff;
  padding: 18px;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.metric strong {
  display: inline-block;
  font-size: 27px;
  margin-top: 8px;
}
.metric small {
  color: var(--muted);
  font-size: 12px;
  margin-left: 3px;
}
.activity-list {
  display: grid;
}
.activity-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid #e8edf3;
  align-items: center;
}
.activity-row:first-child {
  border-top: 0;
}
.activity-type {
  font-size: 12px;
  color: var(--blue);
  font-weight: 900;
}
.activity-title {
  font-weight: 750;
  overflow-wrap: anywhere;
}
.activity-date {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.empty-state {
  padding: 22px 0;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}
.grade-entry-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}
.grade-subject-field {
  grid-column: span 2;
}
.grade-field {
  display: grid;
  gap: 7px;
}
.grade-field label {
  color: #42526a;
  font-size: 12px;
  font-weight: 800;
}
.grade-field input,
.grade-field select {
  width: 100%;
  height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}
.grade-field input:focus,
.grade-field select:focus {
  border-color: var(--blue);
  outline: 3px solid #dbeafe;
}
.grade-add-button {
  height: 44px;
  grid-column: span 2;
  white-space: nowrap;
}
.grade-form-status {
  grid-column: span 2;
  align-self: center;
  margin: 0;
  color: #516177;
  font-size: 13px;
  font-weight: 700;
}
.grade-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.grade-summary div {
  padding: 14px 16px;
  border-left: 1px solid var(--line);
  background: #f8fafc;
}
.grade-summary div:first-child {
  border-left: 0;
}
.grade-summary span,
.grade-summary strong {
  display: block;
}
.grade-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.grade-summary strong {
  margin-top: 5px;
  font-size: 19px;
}
.grade-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}
.grade-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  text-align: left;
}
.grade-table th,
.grade-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #e8edf3;
}
.grade-table thead th {
  background: #f8fafc;
  color: #516177;
  font-size: 12px;
}
.grade-table tbody th {
  font-size: 14px;
}
.grade-table td {
  font-size: 14px;
}
.grade-table th:last-child,
.grade-table td:last-child {
  width: 66px;
  text-align: right;
}
.grade-empty-row td {
  padding: 26px 12px;
  color: var(--muted);
  text-align: center;
}
.grade-remove-button {
  border: 0;
  background: none;
  color: #b42318;
  font-size: 12px;
  font-weight: 800;
  padding: 4px;
}
.profile-list {
  margin: 0;
}
.profile-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid #e8edf3;
}
.profile-row:first-child {
  border-top: 0;
}
.profile-row dt {
  color: var(--muted);
  font-size: 13px;
}
.profile-row dd {
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.profile-note {
  margin: 14px 0 0;
  padding: 12px;
  background: #f7f9fc;
  border-left: 3px solid #a8b6c9;
  color: #5c6d84;
  font-size: 12px;
  line-height: 1.6;
}
.account-warning-summary {
  border-top: 4px solid #d92d20;
}
.warning-counts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.warning-counts div {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
}
.warning-counts span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.warning-counts strong {
  display: block;
  margin-top: 5px;
  color: #b42318;
  font-size: 22px;
}
.warning-summary-text {
  margin: 12px 0 0;
  color: #5c6d84;
  font-size: 12px;
  line-height: 1.6;
}
.side-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.side-actions .portal-btn {
  width: 100%;
}
.withdrawal-button {
  border-color: #efb0aa;
  color: #a4261c;
}
.withdrawal-button:hover {
  background: #fff6f5;
}
.form-group {
  margin-bottom: 15px;
}
.form-group label {
  display: block;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 7px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.portal-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.portal-modal-box {
  width: min(100%, 480px);
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
}
.portal-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.portal-modal-head h2 {
  margin: 0;
  font-size: 22px;
}
.icon-close {
  width: 36px;
  height: 36px;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 6px;
  font-size: 22px;
  line-height: 1;
}
.modal-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.modal-buttons .portal-btn {
  width: 100%;
}
.withdrawal-modal-box {
  width: min(100%, 540px);
  border-top: 5px solid #b42318;
}
.withdrawal-modal-head > div {
  display: grid;
  gap: 4px;
}
.withdrawal-step {
  color: #b42318;
  font-size: 12px;
  font-weight: 900;
}
.withdrawal-warning {
  padding: 16px;
  border: 1px solid #f0c9c5;
  border-radius: 7px;
  background: #fff8f7;
}
.withdrawal-warning strong {
  display: block;
  color: #9f241a;
  font-size: 15px;
}
.withdrawal-warning p,
.withdrawal-final-copy {
  margin: 7px 0 0;
  color: #52627a;
  font-size: 13px;
  line-height: 1.65;
}
.withdrawal-list {
  display: grid;
  gap: 8px;
  margin: 17px 0 20px;
  padding-left: 20px;
  color: #475569;
  font-size: 13px;
  line-height: 1.6;
}
.withdrawal-final-copy {
  margin: 0 0 17px;
}
.withdrawal-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: start;
  margin: 2px 0 8px;
  padding: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  color: #475569;
  font-size: 12px;
  line-height: 1.55;
}
.withdrawal-check input {
  margin-top: 2px;
}
.withdrawal-error {
  min-height: 20px;
  margin: 8px 0 12px;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
}
.teacher-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.teacher-link {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 17px;
  text-decoration: none;
  color: inherit;
}
.teacher-link:hover {
  border-color: #8bb2ee;
  background: #f8fbff;
}
.teacher-link strong {
  display: block;
  margin-bottom: 6px;
}
.teacher-link span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
@media (max-width: 960px) {
  .portal-layout {
    grid-template-columns: 1fr;
  }
  .portal-side {
    position: static;
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grade-entry-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grade-add-button {
    grid-column: span 1;
  }
}
@media (max-width: 640px) {
  .portal-header {
    height: auto;
    min-height: 66px;
  }
  .portal-header-inner {
    padding: 8px 0;
  }
  .portal-brand strong {
    font-size: 17px;
  }
  .portal-brand small {
    display: none;
  }
  .portal-brand img {
    width: 42px;
    height: 42px;
  }
  .portal-btn {
    padding: 0 10px;
    font-size: 13px;
  }
  .portal-shell {
    width: 94%;
    margin-top: 20px;
  }
  .portal-intro {
    align-items: flex-start;
    flex-direction: column;
  }
  .portal-intro h1 {
    font-size: 27px;
  }
  .portal-identity {
    justify-content: flex-start;
  }
  .portal-section {
    padding: 18px;
  }
  .action-grid,
  .teacher-links {
    grid-template-columns: 1fr;
  }
  .action-item {
    min-height: 112px;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metric strong {
    font-size: 23px;
  }
  .grade-entry-form {
    grid-template-columns: 1fr;
  }
  .grade-subject-field,
  .grade-add-button,
  .grade-form-status {
    grid-column: auto;
  }
  .grade-summary {
    grid-template-columns: 1fr;
  }
  .grade-summary div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .grade-summary div:first-child {
    border-top: 0;
  }
  .activity-row {
    grid-template-columns: 1fr auto;
  }
  .activity-type {
    grid-column: 1/-1;
  }
  .profile-row {
    grid-template-columns: 72px 1fr;
  }
}
