:root {
  --paper: #f4f7f5;
  --ink: #17231f;
  --muted: #718078;
  --line: #dbe4de;
  --forest: #16493b;
  --forest-2: #1d624f;
  --mint: #d8f1e3;
  --amber: #b7782d;
  --danger: #a64d4d;
  --white: #fff;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible { outline: 3px solid rgba(29,98,79,.23); outline-offset: 3px; }
.hidden { display: none !important; }
.page-shell { width: min(100% - 40px, 470px); margin: 0 auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; height: 86px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--white); background: var(--forest); font-size: 15px; font-weight: 800; }
.brand-name { font-size: 15px; font-weight: 750; letter-spacing: -.05em; }
.admin-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 13px; border: 1px solid rgba(22,73,59,.15); border-radius: 999px; color: var(--forest); background: rgba(255,255,255,.72); box-shadow: 0 5px 14px rgba(29,61,46,.05); font-size: 11px; font-weight: 750; letter-spacing: -.02em; transition: color .2s, border-color .2s, background .2s, transform .2s, box-shadow .2s; }
.admin-link:hover { border-color: rgba(22,73,59,.35); background: var(--white); box-shadow: 0 8px 18px rgba(29,61,46,.1); transform: translateY(-1px); }
.admin-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(183,120,45,.1); }
.submit-card { margin: 13vh auto 0; padding: 32px 30px 30px; border: 1px solid rgba(22,73,59,.12); border-radius: 18px; background: var(--white); box-shadow: 0 23px 55px rgba(29,61,46,.09); }
.card-kicker { color: var(--amber); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 16px 0 31px; color: var(--ink); font-size: 29px; font-weight: 720; letter-spacing: -.08em; }
label { display: block; margin: 17px 0 8px; color: #52655b; font-size: 11px; font-weight: 700; }
input { width: 100%; height: 53px; padding: 0 15px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: #fbfcfb; font-size: 15px; transition: border-color .2s, box-shadow .2s, background .2s; }
input::placeholder { color: #a9b3ad; }
input:focus { border-color: var(--forest-2); background: var(--white); box-shadow: 0 0 0 4px rgba(29,98,79,.09); }
.primary-button { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 54px; margin-top: 26px; padding: 0 18px 0 20px; border: 0; border-radius: 10px; color: var(--white); background: var(--forest); font-size: 14px; font-weight: 700; letter-spacing: -.03em; transition: background .2s, transform .2s, box-shadow .2s; }
.primary-button:hover { background: var(--forest-2); box-shadow: 0 9px 20px rgba(22,73,59,.16); transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .58; transform: none; }
.button-arrow { font-size: 21px; font-weight: 400; }
.form-message { min-height: 19px; margin: 12px 0 0; color: var(--danger); font-size: 12px; line-height: 1.5; }
.form-message.success { color: var(--forest-2); }
.admin-panel { margin: 34px 0 60px; padding: 25px 22px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.7); box-shadow: 0 16px 38px rgba(29,61,46,.06); }
.admin-close { min-height: 32px; padding: 0 10px; color: var(--muted); border-color: transparent; background: transparent; box-shadow: none; font-weight: 650; }
.admin-close:hover { color: var(--forest); border-color: var(--line); background: var(--white); box-shadow: none; }
.admin-header, .dashboard-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-header h2 { margin: 0 0 20px; font-size: 20px; letter-spacing: -.07em; }
.admin-panel label { margin-top: 13px; }
.admin-panel input { height: 46px; font-size: 14px; }
.admin-panel .primary-button { height: 48px; margin-top: 20px; font-size: 13px; }
.collection-config { margin: 22px 0 19px; padding: 15px; border: 1px solid rgba(22,73,59,.12); border-radius: 11px; background: #f8fbf9; }
.config-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.collection-config strong { color: var(--forest); font-size: 13px; letter-spacing: -.04em; }
.config-controls { display: flex; gap: 7px; margin-top: 12px; }
.config-controls select { flex: 1; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--ink); background: var(--white); font-size: 12px; }
.config-controls select:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(29,98,79,.08); }
.settings-button { min-width: 58px; height: 40px; padding: 0 12px; border: 0; border-radius: 8px; color: var(--white); background: var(--forest-2); font-size: 12px; font-weight: 700; transition: background .2s, transform .2s; }
.settings-button:hover { background: var(--forest); transform: translateY(-1px); }
.settings-button:disabled { cursor: wait; opacity: .58; transform: none; }
.config-message { min-height: 16px; margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.config-message.success { color: var(--forest-2); }
.dashboard-bar { margin-bottom: 15px; color: var(--muted); font-size: 12px; }
.dashboard-bar b { color: var(--forest); font-size: 20px; }
.refresh-button { display: inline-flex; align-items: center; gap: 6px; min-height: 35px; padding: 0 12px; border: 1px solid rgba(22,73,59,.15); border-radius: 999px; color: var(--forest); background: var(--white); box-shadow: 0 4px 12px rgba(29,61,46,.04); font-size: 11px; font-weight: 700; transition: border-color .2s, background .2s, transform .2s, box-shadow .2s; }
.refresh-button:hover { border-color: rgba(22,73,59,.35); background: var(--mint); box-shadow: 0 7px 16px rgba(29,61,46,.08); transform: translateY(-1px); }
.refresh-icon { display: inline-block; color: var(--forest-2); font-size: 16px; line-height: 1; }
.submission-list { display: grid; gap: 9px; }
.submission-row { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.submission-student { margin-bottom: 10px; color: var(--ink); font-size: 13px; font-weight: 750; }
.submission-student small { margin-left: 7px; color: var(--muted); font-size: 10px; font-weight: 400; }
.grade-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.grade-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 7px; color: #50645a; background: var(--paper); font-size: 11px; }
.grade-pill b { display: grid; place-items: center; min-width: 24px; height: 21px; padding: 0 4px; border-radius: 5px; color: var(--white); background: var(--forest-2); font-size: 10px; }
.grade-pill.grade-b b { background: #568a71; }
.grade-pill.grade-c b { background: #9a8861; }
.empty-state { padding: 25px 12px; border: 1px dashed #cbd8d0; border-radius: 10px; color: var(--muted); font-size: 12px; text-align: center; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 13px; }
.admin-logout { min-height: 33px; margin: 14px 0 0 auto; border-color: rgba(166,77,77,.18); color: var(--danger); background: #fff9f9; box-shadow: none; }
.admin-logout:hover { border-color: rgba(166,77,77,.36); color: #8d3838; background: #fff1f1; box-shadow: none; }

@media (max-width: 560px) {
  .page-shell { width: min(100% - 28px, 470px); }
  .site-header { height: 70px; }
  .submit-card { margin-top: 12vh; padding: 27px 21px 24px; border-radius: 15px; }
  h1 { margin-bottom: 26px; font-size: 27px; }
  input { height: 56px; font-size: 16px; }
  .primary-button { height: 56px; margin-top: 25px; }
  .admin-panel { margin-top: 26px; padding: 22px 17px; }
}
