:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #162747;
  background: #f2f6fc;
  font-size: 15px;
  --blue: #2057cb;
  --navy: #12346e;
  --muted: #52637d;
  --line: #dce5f1;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; }
.shell { width: min(1140px, calc(100% - 48px)); margin-inline: auto; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.top-inner { display: flex; justify-content: space-between; align-items: center; min-height: 76px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-size: 1.07rem; font-weight: 750; line-height: 1.2; }
.brand-icon { display: grid; place-items: center; background: #214fae; color: white; border-radius: 12px; width: 41px; height: 41px; font-size: 22px; }
.brand-sub { display: block; color: var(--muted); font-size: .74rem; font-weight: 600; margin-top: 3px; }
nav { display: flex; gap: 8px; }
nav a { border-radius: 9px; padding: 9px 12px; text-decoration: none; font-weight: 650; font-size: .9rem; }
nav a[aria-current], nav a:hover { background: #eaf1ff; color: #1647a9; }
main { min-height: 65vh; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 220px; margin: 28px 0 22px; padding: 34px 46px; position: relative; isolation: isolate; overflow: hidden; border-radius: 23px; color: white; background: linear-gradient(108deg, #122d61, #17489d 67%, #2864cf); }
.hero-copy { max-width: 610px; z-index: 1; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.1rem, 4.7vw, 3.65rem); letter-spacing: -.045em; line-height: 1.03; }
.hero p { color: #e1ecff; margin-top: 15px; font-size: 1.08rem; line-height: 1.55; max-width: 510px; }
.hero-art { position: relative; flex: 0 0 245px; height: 140px; display: grid; place-items: center; }
.hero-art i { position: absolute; border: 1px solid #b8d3ff46; width: 160px; height: 160px; border-radius: 50%; }
.hero-art i:nth-child(2) { width: 205px; height: 205px; }
.hero-art i:nth-child(3) { width: 250px; height: 250px; }
.chart { position: relative; display: flex; align-items: end; gap: 9px; padding: 20px; height: 103px; background: #ffffff24; border: 1px solid #b8d3ff91; border-radius: 17px; transform: rotate(-8deg); }
.chart b { width: 17px; border-radius: 4px 4px 0 0; background: #b7d6ff; height: 43%; }
.chart b:nth-child(2) { height: 61%; }
.chart b:nth-child(3) { height: 54%; }
.chart b:nth-child(4) { height: 98%; background: #fff; }
.student-grid { display: grid; grid-template-columns: minmax(265px, .75fr) minmax(0, 1.25fr); align-items: start; gap: 22px; }
.card { border: 1px solid var(--line); background: #fff; border-radius: 19px; padding: 25px; box-shadow: 0 5px 25px #15335f0a; min-width: 0; }
h2 { font-size: 1.37rem; letter-spacing: -.02em; line-height: 1.28; overflow-wrap: anywhere; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); line-height: 1.55; margin-top: 6px; }
.form-fields, .stack { display: grid; gap: 14px; margin-top: 18px; }
label { display: grid; gap: 6px; font-weight: 650; font-size: .9rem; min-width: 0; }
input, select { background: #fff; border: 1px solid #cbd8e9; color: #162747; border-radius: 9px; min-height: 43px; padding: 8px 11px; width: 100%; }
input::placeholder { color: #63748b; }
:focus-visible { outline: 3px solid #5285ef; outline-offset: 2px; }
.primary, .secondary { border: 1px solid transparent; padding: 9px 15px; min-height: 43px; border-radius: 9px; font-weight: 700; }
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: #1647ae; }
.secondary { color: #1647a9; background: #edf3ff; border-color: #d3e0f8; }
.secondary:hover { background: #dce9ff; }
.primary span { margin-left: 7px; }
.notice { color: var(--muted); margin-top: 10px; line-height: 1.5; }
.notice:empty { display: none; }
.notice.success, .notice.error { border: 1px solid; border-radius: 9px; padding: 8px 12px; }
.notice.success { color: #165642; background: #eaf7f0; border-color: #cae8d9; }
.notice.error { color: #8f2739; background: #fff0f3; border-color: #f1cbd2; }
.results { min-height: 410px; }
.empty { min-height: 352px; display: grid; align-content: center; justify-items: center; text-align: center; gap: 10px; }
.empty p { color: var(--muted); max-width: 285px; line-height: 1.55; }
.empty-icon { background: #eaf1ff; color: #2053b9; border-radius: 15px; width: 58px; height: 58px; display: grid; place-items: center; font-size: 28px; margin-bottom: 5px; }
.result-head p, .certificate-strip p { color: var(--muted); margin-top: 5px; }
.grade-section { margin-top: 22px; }
.scores { list-style: none; padding: 0; margin: 8px 0 0; }
.scores li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 9px 0; }
.scores small { display: block; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.score, .pending { border-radius: 9px; padding: 6px 10px; font-weight: 650; text-align: center; }
.score { background: #e9f3ff; color: #1645a0; min-width: 46px; }
.pending { background: #f2f4f7; color: var(--muted); font-size: .78rem; flex-shrink: 0; }
.certificate-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-radius: 12px; background: #f0f5ff; padding: 15px; margin-top: 22px; }
.footer { display: flex; justify-content: space-between; gap: 10px; padding: 22px 0; margin-top: 25px; border-top: 1px solid var(--line); font-size: .83rem; color: var(--muted); }
.login { max-width: 470px; }
.admin-toolbar, .section-head, .inline-form, .buttons { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.admin-toolbar { align-items: center; margin-bottom: 12px; }
.admin-toolbar span { margin: 0 5px; color: var(--muted); }
.import-card, .work-card { margin-top: 15px; }
.inline-form { justify-content: flex-start; margin-top: 15px; }
.inline-form label { min-width: min(200px, 100%); }
.inline-form input[type=file] { max-width: 100%; }
.section-head select { min-width: min(185px, 100%); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0; padding: 5px; border-radius: 10px; background: #f1f5fc; }
.tabs button { background: transparent; border: 0; border-radius: 7px; color: #415674; font-weight: 700; padding: 9px 13px; }
.tabs button[aria-pressed=true] { color: #1647a9; background: #fff; box-shadow: 0 1px 5px #15335f1b; }
.divider { border-top: 1px solid var(--line); margin: 19px 0; }
.assessment-picker { max-width: 510px; }
.table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 9px 12px; white-space: nowrap; }
th { background: #edf3ff; color: var(--navy); }
td { border-top: 1px solid var(--line); }
.number { width: 100px; min-height: 35px; }
.two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#issue-form > button { justify-self: start; }
@media (max-width: 720px) {
  .shell { width: calc(100% - 28px); }
  .hero { min-height: 165px; padding: 25px; margin-top: 18px; }
  .hero-art { position: absolute; right: -97px; top: 13px; width: 245px; opacity: .27; z-index: -1; }
  .student-grid { grid-template-columns: 1fr; gap: 15px; }
  .results { min-height: 0; }
  .empty { min-height: 200px; }
  .card { padding: 19px; }
}
@media (max-width: 460px) {
  .two-fields { grid-template-columns: 1fr; }
  nav { gap: 0; }
  nav a { padding-inline: 8px; }
  .brand-icon { width: 33px; height: 33px; }
  .certificate-strip { align-items: start; flex-direction: column; }
}

.student-subject { max-width: 400px; margin-top: 17px; }

[hidden] { display: none !important; }
nav a, .jump-class { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.jump-class { text-decoration: none; }
.grade-roster { display: grid; padding: 0; margin: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; }
.grade-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; min-width: 0; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.grade-row:last-child { border-bottom: 0; }
.grade-person { min-width: 0; overflow-wrap: anywhere; }
.grade-person strong { display: block; }
.grade-person span { color: var(--muted); font-size: .85rem; }
.grade-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.grade-actions .notice { margin: 0; }
.report-tip { display: none; }
#result-title, #pengelolaan-kelas { scroll-margin-top: 16px; }
.scores li > div { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 720px) {
  .top-inner { min-height: 64px; }
  .hero { min-height: 0; padding: 23px; }
  .hero p { font-size: 1rem; margin-top: 10px; }
  .student-grid, .form-fields, .stack, .two-fields { grid-template-columns: minmax(0, 1fr); }
  input, select { min-height: 46px; min-width: 0; max-width: 100%; font-size: 16px; }
  .primary, .secondary, .tabs button { min-height: 44px; }
  .inline-form, .section-head { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tabs button { padding-inline: 5px; line-height: 1.2; }
  .grade-row { padding: 9px 12px; }
  .number { width: 82px; min-height: 44px; }
  .grade-actions { position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr); background: #fff; border-top: 1px solid var(--line); padding: 9px 0 calc(9px + env(safe-area-inset-bottom)); }
  .grade-actions .notice:not(:empty) { padding-block: 5px; }
  .report-tip { display: block; }
  #issue-form > button { justify-self: stretch; }
}

@media (max-width: 460px) {
  .shell { width: calc(100% - 24px); }
  .brand { gap: 7px; }
  .card { padding: 15px; }
  .certificate-strip button { width: 100%; }
  .section-head .buttons { display: grid; grid-template-columns: minmax(0, 1fr); }
}

.public-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.4fr); gap: 12px; margin-block: 16px 10px; }
.public-grade-table:not(.grade-matrix) th:first-child { position: sticky; left: 0; box-shadow: 1px 0 var(--line); white-space: normal; overflow-wrap: anywhere; min-width: 140px; }
.public-grade-table tbody th { background: #fff; border-top: 1px solid var(--line); }
.public-grade-table td { text-align: center; }
.public-grade-table small { display: block; font-weight: 500; }
.personal-panel { margin-top: 16px; }
.personal-panel summary { cursor: pointer; font-weight: 750; padding-block: 10px; }
.personal-panel[open] > summary { margin-bottom: 12px; }
@media (max-width: 600px) {
  .public-filters { grid-template-columns: minmax(0, 1fr); }
  .public-grade-table:not(.grade-matrix) th:first-child { min-width: 112px; max-width: 138px; }
}

:root { background: #edf3fc; }
body { background: radial-gradient(ellipse at 92% 3%, #dce9ff 0, transparent 36rem), #f4f7fd; }
.topbar { background: #ffffffed; }
.brand-icon { background: linear-gradient(145deg, #153879, #3473ed); box-shadow: 0 4px 12px #2455be32; }
.hero {
  background: radial-gradient(ellipse at 84% 24%, #4888ed94, transparent 52%), linear-gradient(116deg, #122955, #173f8c 61%, #2863ca);
  box-shadow: 0 16px 33px -20px #1a4693a0;
}
.card { border-color: #e0e8f7; box-shadow: 0 12px 32px -23px #28487982; }
.public-grades { padding: clamp(17px, 3vw, 32px); }
.panel-heading { display: flex; align-items: center; gap: 12px; }
.panel-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; color: #194aa9; background: #eaf1ff; border-radius: 12px; font-size: 1.22rem; font-weight: 800; }
.public-filters { background: #f3f7fe; border: 1px solid #e7eefb; border-radius: 14px; padding: 14px; }
.public-grade-table th { background: #e8f0fd; }
.public-grade-table tbody tr:nth-child(even) > * { background: #f5f8ff; }
.public-grade-table tbody th { font-weight: 700; }
.public-grade-table td { font-variant-numeric: tabular-nums; }
.public-grade-table td:last-child { color: #465b79; }
.startup-card { max-width: 680px; }
.startup-card .panel-icon { background: #fff1ed; color: #a33929; }
#public-status { margin-top: 12px; }
@media (max-width: 600px) {
  .public-filters { padding: 12px; gap: 10px; }
  .public-grade-table th, .public-grade-table td { padding-inline: 10px; }
}

/* Portal visual language */
:root {
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color: #14264a;
  --blue: #224fcc;
  --navy: #132751;
  --muted: #546682;
  --line: #dce5f3;
}
body { background: #f1f5fc; }
.shell { width: min(1200px, calc(100% - 56px)); }
.topbar { background: #fff; border-bottom: 1px solid #e3eaf6; }
.top-inner { min-height: 70px; }
.brand-icon, .document-mark { display: flex; align-items: end; justify-content: center; gap: 3px; padding: 11px; }
.brand-icon i, .document-mark i { width: 4px; height: 38%; border-radius: 2px; background: #c8e5ff; }
.brand-icon i:nth-child(2), .document-mark i:nth-child(2) { height: 69%; }
.brand-icon i:nth-child(3), .document-mark i:nth-child(3) { height: 100%; background: #fff; }
nav { padding: 3px; background: #f1f5fc; border-radius: 13px; }
nav a { border-radius: 10px; }
nav a[aria-current] { background: #fff; color: #1c46b0; box-shadow: 0 2px 8px #1c3d7918; }
.hero {
  min-height: 242px; padding: 43px clamp(25px, 5vw, 66px); margin-block: 29px 23px;
  border-radius: 26px; background: radial-gradient(ellipse at 86% 55%, #356dca 0, transparent 55%), linear-gradient(110deg, #101f42, #152f65 65%, #2255ab);
  box-shadow: 0 24px 43px -34px #173477;
}
.hero h1 { font-weight: 780; font-size: clamp(2rem, 5vw, 3.65rem); letter-spacing: -.06em; }
.hero p { max-width: 42ch; color: #dce8ff; }
.hero-art { height: 164px; flex-basis: 250px; isolation: isolate; }
.hero-orbit { position: absolute; z-index: -1; inset: -26px 4px; border: 1px solid #a6c7ff52; border-radius: 50%; box-shadow: 0 0 0 22px #8eb8ff15, 0 0 0 51px #8eb8ff0d; }
.hero-document { display: grid; justify-items: start; align-content: start; gap: 9px; width: 144px; height: 171px; padding: 14px; border-radius: 17px; background: #f2f7ff; transform: rotate(-10deg); box-shadow: 0 18px 38px #0c174f58; }
.document-mark { width: 33px; height: 31px; padding: 8px; background: #2759cb; border-radius: 8px; }
.document-mark i { position: static; width: 3px; border: 0; }
.document-mark i:nth-child(2), .document-mark i:nth-child(3) { width: 3px; }
.document-line { width: 62%; height: 5px; border-radius: 8px; background: #acbddd; }
.document-line.short { width: 36%; background: #cedaee; }
.hero-document .chart { width: 100%; height: 59px; gap: 5px; padding: 7px 9px; background: #e4edfd; border: 0; border-radius: 8px; transform: none; }
.hero-document .chart b { flex: 1; width: auto; height: 34%; background: #91b6fb; }
.hero-document .chart b:nth-child(2) { height: 55%; }
.hero-document .chart b:nth-child(3) { height: 48%; }
.hero-document .chart b:nth-child(4) { height: 75%; background: #6194f5; }
.hero-document .chart b:nth-child(5) { height: 97%; background: #285cd1; }
.hero-check { position: absolute; right: 33px; bottom: 6px; display: grid; place-items: center; width: 49px; height: 49px; border: 3px solid #dff6ff; border-radius: 16px; background: #9edcf5; color: #143671; font-size: 1.45rem; font-weight: 800; transform: rotate(10deg); }
.card { border: 1px solid #dce5f3; border-radius: 22px; box-shadow: 0 12px 27px -22px #112e65a0; }
.panel-icon { background: #eaf1ff; color: #224fbd; }
.public-filters { margin-block: 22px 10px; padding: 14px; background: #eef4ff; border-radius: 16px; }
input, select { min-height: 46px; border-radius: 11px; }
input:focus, select:focus { border-color: #426cdf; }
.search-control { display: block; position: relative; min-width: 0; }
.search-control::before { content: ''; position: absolute; left: 13px; top: 15px; width: 9px; height: 9px; border: 2px solid #4e65a2; border-radius: 50%; pointer-events: none; }
.search-control::after { content: ''; position: absolute; left: 24px; top: 27px; width: 6px; height: 2px; transform: rotate(45deg); background: #4e65a2; pointer-events: none; }
.search-control input { padding-left: 36px; }
.primary, .secondary { border-radius: 11px; }
.primary { background: linear-gradient(150deg, #3264df, #224bc0); }
.primary:hover { background: #1c43b1; }
.table-caption { min-height: 22px; font-size: .92rem; }
.public-grade-table th { background: #e9f0ff; }
.public-grade-table tbody tr:nth-child(even) > * { background: #f7f9ff; }
.public-grade-table th, .public-grade-table td { padding-block: 13px; }
.public-grade-table .pdf-button { min-height: 42px; }
.personal-panel > summary { min-height: 44px; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: stretch; gap: 20px; margin-top: 29px; }
.auth-layout .hero { margin: 0; flex-direction: column; align-items: start; justify-content: center; gap: 30px; padding: clamp(24px, 4vw, 50px); }
.auth-layout .hero h1 { font-size: clamp(2rem, 4vw, 3rem); }
.auth-layout .hero-art { flex-basis: auto; width: min(100%, 250px); align-self: center; }
.auth-layout .login { display: flex; flex-direction: column; justify-content: center; padding: clamp(21px, 4vw, 45px); max-width: none; }
.admin-toolbar { gap: 14px; }
.admin-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; flex: 1 1 390px; max-width: 560px; margin: 0; }
.admin-metrics > div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; min-width: 0; }
.admin-metrics dt { color: var(--muted); font-size: .78rem; line-height: 1.25; }
.admin-metrics dd { margin: 2px 0 0; font-size: 1.35rem; color: #1e49ae; font-weight: 780; }
.admin-tools { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 14px; }
.admin-tools label { min-width: 0; }
.admin-tools .inline-form label { flex: 1 0 100%; }
.admin-tools .inline-form input[type=file]::file-selector-button { color: #1c46a5; background: #eaf1ff; border: none; border-radius: 6px; padding: 5px 8px; margin-right: 8px; cursor: pointer; }
.work-card { margin-top: 14px; }
.footer { color: #4f6485; }

@media (max-width: 720px) {
  .shell { width: calc(100% - 24px); }
  .top-inner { min-height: 64px; }
  .hero { min-height: 164px; padding: 23px 20px; margin-block: 16px; border-radius: 20px; }
  .hero-copy { position: relative; }
  .hero h1 { font-size: clamp(2rem, 7vw, 3rem); }
  .hero-art { right: -76px; top: 7px; width: 221px; opacity: .23; }
  .auth-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 16px; }
  .auth-layout .hero { padding: 22px 20px; min-height: 140px; }
  .auth-layout .login { padding: 20px; }
  .admin-tools { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .admin-metrics { flex-basis: 100%; max-width: none; }
  .admin-metrics > div { padding: 9px; }
}

.grade-matrix { border-collapse: separate; border-spacing: 0; text-align: center; }
.grade-matrix th, .grade-matrix td { text-align: center; border-right: 1px solid var(--line); }
.grade-matrix thead th { border-bottom: 1px solid var(--line); background: #e7efff; }
.grade-matrix thead tr:first-child th { background: #dce8ff; }
.grade-matrix .matrix-no, .grade-matrix .matrix-name { position: sticky; z-index: 1; background: #fff; }
.grade-matrix .matrix-no { left: 0; width: 46px; min-width: 46px; max-width: 46px; padding-inline: 4px; }
.grade-matrix .matrix-name { left: 46px; min-width: 145px; max-width: 230px; text-align: left; white-space: normal; overflow-wrap: anywhere; box-shadow: 1px 0 var(--line); }
.grade-matrix tbody tr:nth-child(even) > * { background: #f8faff; }
.grade-matrix tbody th { border-top: 1px solid var(--line); }
.grade-matrix .matrix-mean { background: #edf5ff; color: #174aa9; font-weight: 700; }
.grade-matrix .matrix-empty { color: var(--muted); }
.grade-matrix .matrix-input { width: 84px; min-height: 42px; }
@media (max-width: 600px) {
  .grade-matrix .matrix-no { width: 36px; min-width: 36px; max-width: 36px; }
  .grade-matrix .matrix-name { left: 36px; min-width: 105px; max-width: 132px; }
  .grade-matrix th, .grade-matrix td { padding-inline: 8px; }
  .grade-matrix .matrix-input { width: 70px; }
}

#data-siswa { scroll-margin-top: 16px; }
#student-roster { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
#student-roster summary { cursor: pointer; font-weight: 750; padding-block: 9px; }
.danger-button { color: #92203a; background: #fff1f4; border-color: #efcbd4; }
.danger-button:hover { background: #fbdde5; }

.edit-grade {
  display: block; padding: 5px 7px; margin: 4px 0 0;
  color: #214aaf; background: #edf3ff; border: 1px solid #d7e4fa;
  border-radius: 7px; font-size: .78rem; font-weight: 700;
}
.edit-grade:hover { background: #dce9ff; }
#grades-form tr:focus-within > .matrix-name { background: #dfebff; }
#grades-form .matrix-input { scroll-margin-inline-start: 160px; }
#grades-form .grade-actions { position: sticky; bottom: 0; z-index: 2; background: #fff; padding-block: 8px; }

.remove-column {
  display: block; margin: 4px auto 0; padding: 4px 7px; border-radius: 6px;
  border: 1px solid #efcbd4; background: #fff1f4; color: #92203a;
  font-size: .75rem; font-weight: 700;
}
.remove-column:hover { background: #fbdde5; }

.add-column-inline {
  display: block; margin: 5px auto 0; padding: 5px 8px;
  border-radius: 7px; border: 1px solid #adc6f4; background: #f5f9ff;
  color: #174ba8; font-weight: 700; font-size: .76rem; white-space: normal;
}
.add-column-inline:hover { background: #d5e5ff; }

.column-dialog {
  position: fixed; inset: 0; width: min(440px, calc(100vw - 32px)); max-width: none;
  margin: auto; padding: 20px; border: 1px solid var(--line); border-radius: 14px;
  color: #14264a; background: #fff; box-shadow: 0 12px 40px #182f6b40; z-index: 20;
}
.column-dialog::backdrop { background: #12265066; }
.column-dialog .buttons { justify-content: flex-end; margin-top: 14px; }

.table-wrap { border-radius: 14px; border: 1px solid #d8e5f5; box-shadow: 0 4px 16px #24466e0d; }
.grade-matrix thead tr:first-child th { background: #173963; color: #fff; }
.grade-matrix thead tr:nth-child(2) th { background: #dbeafc; color: #123457; }
.grade-matrix thead tr:nth-child(3) th { background: #f0f6fd; color: #214a69; }
.grade-matrix thead tr th.matrix-mean, .grade-matrix tbody td.matrix-mean { background: #e5f5f2; color: #0a615e; }
.grade-matrix tbody tr:nth-child(even) > * { background: #f7faff; }
.grade-matrix tbody tr:hover > :not(.matrix-mean) { background: #edf5ff; }
.grade-matrix td, .grade-matrix th { border-right-color: #dce8f5; }
.grade-matrix .matrix-input { border-radius: 9px; border-color: #b5cce6; }
.grade-matrix .matrix-input:focus { border-color: #0a7773; }
.grade-matrix .matrix-name { box-shadow: 2px 0 5px #142b4e12; }
.report-settings, .certificate-controls { margin: 15px 0; padding: 14px; border: 1px solid #d9e6f7; background: #f5f9ff; border-radius: 12px; }
.report-settings summary { font-weight: 750; cursor: pointer; color: #173963; }
.certificate-controls th[scope="row"] { background: #fff; color: #14264a; }
.certificate-state { display: inline-block; border-radius: 12px; background: #edf1f6; color: #46566f; padding: 4px 10px; font-weight: 750; }
.certificate-state.is-active { background: #d8f3e9; color: #075c4b; }
@media (max-width: 600px) {
  .grade-matrix .matrix-no { width: 30px; min-width: 30px; max-width: 30px; }
  .grade-matrix .matrix-name { left: 30px; min-width: 94px; max-width: 118px; }
  .report-settings, .certificate-controls { padding: 10px; }
}

/* Wide gradebook work area */
.admin-page .shell { width: min(1840px, calc(100% - clamp(24px, 4vw, 78px))); }
.admin-page .work-card { min-width: 0; padding: clamp(16px, 2vw, 32px); }
.admin-page #pengelolaan-kelas > .panel-heading {
  padding: 16px 20px; border-radius: 14px; color: #fff;
  background: linear-gradient(112deg, #0b2044, #163f78 66%, #235aa0);
}
.admin-page #pengelolaan-kelas > .panel-heading .muted { color: #dceaff; }
.admin-page #pengelolaan-kelas > .panel-heading .panel-icon { color: #fff; background: #ffffff20; }
.admin-page .class-filters { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 380px); gap: 14px; }
.admin-page #assessment-form { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr) max-content; gap: 12px; }
.admin-page .tabs { background: #e8effb; }
.admin-page .tabs button[aria-pressed=true] {
  color: #fff; background: linear-gradient(130deg, #17396b, #2764c5);
  box-shadow: 0 3px 10px #1f5bb540;
}
.admin-page .primary {
  color: white; background: linear-gradient(145deg, #0879f2, #164ed6);
  box-shadow: 0 4px 12px #215ee342, inset 0 1px 0 #ffffff46;
}
.admin-page .primary:hover { background: linear-gradient(145deg, #1988ff, #1544bf); }
.admin-page .primary, .admin-page .secondary, .admin-page .tabs button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.admin-page .grade-matrix thead tr:first-child th {
  background: linear-gradient(170deg, #123053, #1e4d85); color: #fff;
}
.admin-page .grade-matrix thead tr:nth-child(2) th { background: linear-gradient(160deg, #d6e7fe, #eaf3ff); }
.admin-page .grade-matrix .matrix-input { width: clamp(67px, 5vw, 82px); }
.admin-page .grade-matrix th, .admin-page .grade-matrix td { padding-inline: 8px; }
.admin-page .grade-matrix .matrix-no { padding-inline: 4px; }
.admin-page .grade-matrix .matrix-name { min-width: 154px; }
.admin-page .add-column-inline, .admin-page .remove-column, .admin-page .edit-grade {
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.admin-page .add-column-inline { color: #fff; border-color: #2861c3; background: linear-gradient(135deg, #287df2, #1c51b6); }
.admin-page .add-column-inline:hover { background: #1749a0; }
.matrix-navigation {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  color: var(--muted); font-size: .85rem; margin-block-end: -8px;
}
.matrix-arrows { display: flex; gap: 6px; }
.matrix-arrows button { width: 40px; min-height: 36px; padding: 0; }
.matrix-arrows button:disabled { cursor: default; }
.ui-icon { display: inline-grid; place-items: center; inline-size: 1.05em; block-size: 1.05em; flex: 0 0 auto; font-size: 1.02em; line-height: 1; }
.ui-icon[data-icon="plus"]::before { content: "✚"; }
.ui-icon[data-icon="edit"]::before { content: "✎"; }
.ui-icon[data-icon="trash"]::before { content: "×"; font-size: 1.25em; }
.ui-icon[data-icon="save"]::before { content: "✓"; }
.ui-icon[data-icon="upload"]::before { content: "↑"; }
.ui-icon[data-icon="download"]::before { content: "↓"; }
.ui-icon[data-icon="grid"]::before { content: "▦"; }
.ui-icon[data-icon="person"]::before { content: "♙"; }
.ui-icon[data-icon="print"]::before { content: "▤"; }
.ui-icon[data-icon="award"]::before { content: "✦"; }
.ui-icon[data-icon="left"]::before { content: "❮"; }
.ui-icon[data-icon="right"]::before { content: "❯"; }
@media (max-width: 720px) {
  .admin-page .shell { width: calc(100% - 20px); }
  .admin-page .work-card { padding: 12px; }
  .admin-page #pengelolaan-kelas > .panel-heading { padding: 14px; }
  .admin-page #assessment-form, .admin-page .class-filters { grid-template-columns: minmax(0, 1fr); }
  .admin-page .tabs button { gap: 4px; font-size: .82rem; }
  .admin-page .grade-matrix .matrix-name { min-width: 104px; max-width: 128px; }
  .matrix-arrows button { width: 44px; min-height: 44px; }
}

#subject-cert-profile { margin-block: 12px; }
.activation-check { display: inline-flex; align-items: center; gap: 8px; white-space: normal; }
.activation-check input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: #175bd6; }
.public-certificate-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

#subject-cert-template textarea {
  width: 100%; padding: 11px; border-radius: 11px; border: 1px solid #cbd8e9;
  background: #fff; color: #14264a; font: inherit; resize: vertical;
}

.certificate-logo-option { display: grid; gap: 7px; padding: 12px; border: 1px solid #d7e4f5; border-radius: 11px; background: #fff; }
.certificate-logo-option input[type="file"] { min-width: 0; width: 100%; }
