:root {
  --bg: #f4f7f6;
  --text: #242d2b;
  --muted: #788580;
  --line: #e2e9e5;
  --accent: #117f70;
  --danger: #ce554d;
  --panel: #fff;
}
body { font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif; letter-spacing: 0; }
button, a, input, select, textarea { transition: background .16s, border-color .16s, box-shadow .16s, transform .16s; }
button:focus-visible, a:focus-visible { outline: 3px solid #75cebe; outline-offset: 3px; }
button:hover, .button:hover { background: #0a695d; box-shadow: 0 4px 12px #117f701a; }
button:active, .button:active { transform: translateY(1px); }
.workspace .topbar { width: 224px; height: 100dvh; position: fixed; inset: 0 auto 0 0; flex-direction: column; align-items: stretch; justify-content: flex-start; background: #232d2a; border: 0; padding: 30px 18px 18px; color: #f7faf8; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-size: 21px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: #b3e8cc; border-radius: 8px; flex-shrink: 0; }
.brand-mark img { width: 22px; height: 22px; }
.brand small { display: block; font-size: 11px; font-weight: 400; color: #aebeb4; margin-top: 5px; }
.workspace .topbar nav { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-top: 38px; flex: 1; min-height: 0; overflow-y: auto; }
.nav-label { font-size: 10px; color: #96a99f; padding: 16px 14px 7px; }
.workspace .topbar nav > a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 14px; color: #bac7bf; border-radius: 6px; font-size: 14px; }
.workspace .topbar nav > a img, .nav-form button img { width: 18px; height: 18px; opacity: .8; filter: invert(1); }
.workspace .topbar nav > a:hover { background: #33413b; color: white; }
.workspace .topbar nav > a.active { color: #d3ffe7; background: #3c5146; box-shadow: inset 3px 0 #b3e8cc; }
.workspace .nav-form { display: flex; align-items: center; gap: 9px; border-top: 1px solid #ffffff14; margin-top: auto; padding: 22px 6px 0; }
.account-avatar { width: 32px; height: 32px; display: grid; place-items: center; color: #252f29; background: #f1cd85; border-radius: 8px; font-weight: 700; flex-shrink: 0; }
.account-name { flex: 1; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.account-name small { display: block; color: #96a99f; font-size: 10px; margin-top: 4px; }
.nav-form .link-button { width: 32px; height: 32px; display: grid; place-items: center; }
.workspace .page { margin-left: 224px; max-width: 1600px; padding: 34px 44px 60px; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { display: block; color: #83938a; font-size: 10px; font-weight: 600; margin-bottom: 9px; }
.workspace-heading h1 { font-size: 25px; font-weight: 650; line-height: 1.5; }
.workspace-heading time { flex-shrink: 0; color: #718079; font-size: 12px; font-variant-numeric: tabular-nums; }
.student-picker { justify-content: flex-end; margin: -4px 0 25px; }
.student-picker label { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.student-picker select { min-height: 36px; min-width: 120px; padding: 6px 28px 6px 12px; background: white; }
.student-picker button { min-height: 36px; padding: 6px 14px; font-size: 12px; }
.student-picker .student-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-editor { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.avatar-catalog-image { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: #e7efeb; }
.avatar-fields { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 14px; }
.avatar-wide { grid-column: 1 / -1; }
.avatar-fields input[type=file] { max-width: 100%; font-size: 11px; }
@media (max-width: 760px) {
  .avatar-editor { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .avatar-catalog-image { width: 56px; height: 56px; }
  .avatar-fields { grid-template-columns: minmax(0, 1fr); }
}
.summary-grid { gap: 18px; }
.metric { position: relative; min-height: 154px; border: 0; padding: 26px; overflow: hidden; }
.metric .label { font-size: 12px; }
.metric strong { margin-top: 19px; font-size: 35px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-child { background: #e5f1ea; }
.metric-points { background: #fff0d3; }
.metric-checkins { background: #fce7e1; }
.metric-icon { position: absolute; top: 23px; right: 24px; width: 32px; height: 32px; display: grid; place-items: center; background: #ffffff80; border-radius: 8px; }
.metric-icon img { width: 18px; height: 18px; opacity: .7; }
.section { border: 0; border-radius: 0; padding: 0; margin-top: 34px; background: transparent; }
.binding-strip { display: flex; align-items: end; gap: 14px; padding: 16px 20px; background: #eaf2ed; border-left: 3px solid #8fc4a6; margin: 0 0 24px; }
.binding-strip label { flex: 1; max-width: 360px; }
.section-head { margin-bottom: 18px; }
.section-head h1 { font-size: 18px; }
.section-head .muted { font-size: 12px; }
.section-head .button { background: none; color: var(--accent); font-size: 12px; padding: 6px 0 6px 12px; box-shadow: none; }
.panel { border-color: #e2e9e5; box-shadow: 0 2px 5px #273c2c03; }
.two-column { gap: 24px; grid-template-columns: minmax(0, 1fr) 300px; }
.two-column > aside { padding: 24px; background: #fff; }
.two-column > aside h2 { margin-bottom: 22px; font-size: 17px; }
.checkin-grid { gap: 16px; }
.checkin-card { background: white; border: 1px solid #e2e9e5; box-shadow: 0 2px 6px #263e2b04; transition: box-shadow .18s, transform .18s; }
.checkin-card:hover { transform: translateY(-3px); box-shadow: 0 9px 24px #223d2a12; }
.checkin-image { aspect-ratio: 4 / 3; background: #e7efeb; }
.checkin-meta { min-height: 50px; font-size: 12px; gap: 8px; }
.status { font-size: 11px; border-radius: 5px; padding: 6px 8px; }
.status.pending { background: #fff2d4; color: #966c17; }
.status.approved { background: #e5f4ec; color: #26805a; }
.status.rejected { background: #fbe6e2; color: #b84e43; }
table { background: white; border: 1px solid var(--line); font-size: 13px; }
th { background: #edf3ef; color: #74847a; font-size: 11px; padding: 14px 16px; white-space: nowrap; }
td { padding: 18px 16px; line-height: 1.6; }
tbody tr:hover { background: #f7faf8; }
.positive, .negative { font-variant-numeric: tabular-nums; }
.positive { color: #168769; }
.negative { color: #d76854; }
button, .button { font-size: 13px; min-height: 38px; }
button.danger { background: #fbeae6; color: #ba5946; }
button.danger:hover { background: #f7d4ca; }
.redemption-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.redemption-actions button { flex: 0 0 auto; }
.checkin-subject-edit, .checkin-subject-edit label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.checkin-subject-edit { margin: 12px 0; }
.checkin-subject-edit label { color: var(--muted); font-size: 12px; }
.checkin-subject-edit select { min-height: 38px; max-width: 100%; }
.redemption-table-scroll { max-width: 100%; overflow-x: auto; }
.redemption-table-scroll table { min-width: 640px; }
.upload-delete-link { color: #ba5946; }
.upload-delete-link:hover { text-decoration: underline; }
.upload-delete-confirm { max-width: 680px; }
.upload-delete-confirm .actions > .button,
.upload-delete-confirm .actions > button { display: flex; align-items: center; justify-content: center; text-align: center; }
.upload-delete-preview { display: block; width: 100%; height: 260px; object-fit: contain; background: #e7efeb; border-radius: 6px; }
.upload-delete-details { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px; font-size: 13px; margin: 24px 0; }
.upload-delete-details dt { color: var(--muted); }
.upload-delete-details dd { margin: 0; overflow-wrap: anywhere; }
.upload-delete-warning { padding: 16px; background: #fbeae6; color: #963f32; font-size: 13px; line-height: 1.8; border-left: 3px solid #ce554d; margin: 24px 0; }
.upload-delete-check { display: flex; align-items: flex-start; gap: 10px; }
.upload-delete-check input { flex: 0 0 18px; width: 18px; height: 18px; margin: 1px 0 0; }
.checkins-section .section-head { flex-wrap: wrap; gap: 16px; }
.checkins-section .section-head h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.checkin-count { font-size: 12px; color: var(--muted); font-weight: 400; }
.checkins-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0; }
.checkins-filter label { display: flex; align-items: center; gap: 10px; }
.checkins-filter select { min-height: 38px; }
.checkin-list { border-top: 1px solid var(--line); }
.checkin-entry { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); align-items: start; }
.checkin-entry.needs-review { grid-template-columns: 176px minmax(0, 1fr) 280px; }
.checkin-photo { width: 100%; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; background: #e7efeb; border: 1px solid #dfe8e2; border-radius: 6px; overflow: hidden; }
.checkin-photo > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.checkin-extra-photos { display: flex; flex-wrap: wrap; gap: 12px; padding: 0; list-style: none; }
.checkin-extra-photos li { width: 74px; font-size: 11px; }
.checkin-extra-photos img { display: block; width: 74px; height: 60px; object-fit: contain; background: #e7efeb; border-radius: 5px; }
.checkin-photo img[hidden], .checkin-photo-fallback[hidden] { display: none; }
.checkin-photo-fallback { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #718079; font-size: 11px; padding: 10px; text-align: center; }
.checkin-photo-fallback img { width: 24px; height: 24px; opacity: .45; }
.checkin-photo:not([href]) { cursor: default; }
.checkin-file { flex-direction: column; gap: 12px; color: var(--muted); font-size: 12px; }
.checkin-file > img { width: 28px; height: 28px; opacity: .55; }
.checkin-info { min-width: 0; }
.checkin-heading { display: flex; align-items: flex-start; gap: 12px; }
.checkin-heading h2 { flex: 1; min-width: 0; padding-top: 7px; font-size: 15px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.checkin-file-actions { display: flex; flex-shrink: 0; gap: 4px; }
.checkin-icon-action { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; }
.checkin-icon-action img { width: 17px; height: 17px; opacity: .65; }
.checkin-icon-action:hover { background: #e1eee7; }
.checkin-icon-action.upload-delete-link:hover { background: #fbeae6; }
.checkin-date { display: block; color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 5px; }
.checkin-state { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.checkin-award { color: #26805a; font-size: 12px; font-variant-numeric: tabular-nums; }
.checkin-note { margin: 12px 0 0; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.checkin-note > span { color: var(--muted); margin-right: 10px; font-size: 11px; }
.checkin-review { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 12px; border-left: 1px solid var(--line); padding-left: 24px; }
.checkin-review input { min-height: 38px; }
.checkin-review-actions { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }
.checkin-review-actions button { flex: 1; padding: 9px 10px; }
.checkins-empty { padding: 64px 16px; text-align: center; color: var(--muted); }
.checkins-empty img { width: 36px; height: 36px; opacity: .4; margin-bottom: 18px; }
.checkins-empty h2 { font-size: 14px; font-weight: 400; }
.checkin-preview-trigger { width: 100%; padding: 0; border: 0; min-height: 0; cursor: zoom-in; }
.checkin-preview-trigger:hover { background: #e7efeb; box-shadow: none; }
.checkin-preview-trigger:active { transform: none; }
.image-preview-dialog { width: min(1080px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 48px)); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--text); overflow: hidden; }
.image-preview-dialog[open] { display: flex; flex-direction: column; }
.image-preview-dialog::backdrop { background: #14231dcc; }
.image-preview-dialog [hidden] { display: none !important; }
.image-preview-header { display: flex; align-items: center; flex-shrink: 0; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.image-preview-header h2 { flex: 1; min-width: 0; margin-right: 8px; max-height: 64px; overflow: auto; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.image-preview-dialog .preview-icon { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 6px; background: transparent; color: var(--text); box-shadow: none; }
.image-preview-dialog .preview-icon:hover { background: #e7efeb; }
.image-preview-dialog .preview-icon:disabled { opacity: .3; cursor: not-allowed; }
.preview-icon img { width: 18px; height: 18px; }
.preview-previous img { transform: rotate(180deg); }
.image-preview-stage { flex: 1; min-height: 0; position: relative; background: #edf1ef; }
.image-preview-canvas { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: auto; }
.image-preview-canvas img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.image-preview-loading, .image-preview-error { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--muted); font-size: 13px; }
.image-preview-error p { margin: 0; }
.image-preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 16px; flex-shrink: 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.image-preview-navigation { display: flex; gap: 8px; }
@media (min-width: 761px) and (max-width: 1199px) {
  .checkin-entry.needs-review { grid-template-columns: 160px minmax(0, 1fr); }
  .checkin-review { grid-column: 2; border-left: 0; padding: 0; max-width: 420px; }
}
@media (max-width: 760px) {
  .checkins-section .section-head { align-items: flex-start; flex-direction: column; }
  .checkins-filter { width: 100%; }
  .checkins-filter label { flex: 1; }
  .checkins-filter select { flex: 1; }
  .checkin-entry, .checkin-entry.needs-review { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 20px 0; }
  .checkin-heading { flex-direction: column; gap: 5px; }
  .checkin-heading h2 { padding-top: 0; font-size: 14px; }
  .checkin-file-actions { order: 1; margin-left: -8px; }
  .checkin-date { margin-top: 0; font-size: 11px; }
  .checkin-state { margin-top: 10px; gap: 6px; }
  .checkin-review { grid-column: 1 / -1; border-left: 0; padding: 16px 0 0; border-top: 1px dashed var(--line); }
  .checkin-note { font-size: 12px; }
}
input, textarea, select { min-width: 0; background: #fafcfb; border-color: #dfe8e2; font-size: 13px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #65b29c; box-shadow: 0 0 0 3px #16876912; background: white; }
input[type=checkbox] { accent-color: var(--accent); }
label { font-size: 12px; line-height: 1.6; }
.stack { gap: 16px; }
.form-grid { padding: 20px; }
.reward-edit-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 80px));
  justify-content: start;
  gap: 8px;
}
.point-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}
.point-rule-list { list-style: none; margin: 12px 0; padding: 0; }
.point-rule-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  overflow-wrap: anywhere;
}
.point-rule-list strong { flex-shrink: 0; font-size: 14px; }
.point-rule-form button { justify-self: start; }
.pet-admin-grid { padding: 22px; }
.pet-preview-box { width: 104px; }
.empty { padding: 35px 10px; font-size: 13px; }
.page > nav { margin-top: 24px; font-size: 12px; gap: 18px; }
.subject-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; margin: 18px 0 24px; }
.subject-stat-item { min-width: 0; padding: 16px; border: 1px solid #dce8e1; border-radius: 8px; background: white; }
.subject-stat-item h3 { margin: 0; font-size: 15px; }
.subject-stat-item p { margin: 8px 0 12px; color: #60786a; font-size: 12px; }
.subject-stat-item strong { color: #117f70; font-size: 24px; }
.subject-stat-item dl { margin: 0; font-size: 12px; }
.subject-stat-item dl div { display: flex; justify-content: space-between; gap: 12px; line-height: 1.9; }
.subject-stat-item dd { margin: 0; }
.subject-badge { display: inline-block; background: #e5eee8; color: #365e48; border-radius: 4px; padding: 3px 7px; font-size: 12px; white-space: nowrap; }
.checkin-meta { flex-wrap: wrap; gap: 6px; }
.checkins-section > .section-head { flex-wrap: wrap; gap: 12px; }
.checkins-filter { flex-wrap: wrap; }
.checkins-filter label { min-width: 0; }
.checkins-filter input[type=date] { min-width: 0; max-width: 100%; }
@media (max-width: 700px) {
  .checkins-filter { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
  .checkins-filter label { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; white-space: nowrap; }
  .checkins-filter select, .checkins-filter input[type=date] { width: 100%; min-width: 0; box-sizing: border-box; }
  .subject-summary { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
  .subject-stat-item { padding: 10px; }
  .subject-stat-item h3 { font-size: 13px; }
  .subject-stat-item p { font-size: 11px; overflow-wrap: anywhere; }
  .subject-stat-item strong { font-size: 22px; }
  .subject-stat-item dl { font-size: 11px; }
  .subject-stat-item dl div { gap: 6px; }
  .subject-stat-item dt { flex-shrink: 0; }
  .subject-stat-item dd { min-width: 0; overflow-wrap: anywhere; text-align: right; }
}
.guest .topbar { background: transparent; border-bottom: 1px solid #e2e9e5; }
.guest .brand small { color: #788580; }
.guest .topbar nav { display: none; }
.guest .page { max-width: 1100px; }
.login-wrap { min-height: calc(100dvh - 200px); }
.login-panel { max-width: 420px; border: 0; border-top: 4px solid #117f70; background: white; padding: 36px; box-shadow: 0 16px 50px #334e3210; }
.login-panel h1 { font-size: 27px; margin: 18px 0 10px; }
.login-panel p { font-size: 13px; margin-bottom: 28px; }
.login-panel button { margin-top: 8px; min-height: 44px; }
@media (min-width: 1800px) { .workspace .page { margin-left: max(224px, calc((100vw - 1376px) / 2)); } }
@media (max-width: 1150px) { .workspace .page { padding: 28px; } .two-column { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .workspace .topbar { position: relative; width: 100%; height: auto; padding: 18px; gap: 16px; }
  .workspace .topbar nav { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; overflow: visible; }
  .workspace .topbar nav > a { gap: 7px; font-size: 11px; padding: 9px 7px; min-height: 39px; white-space: nowrap; }
  .workspace .topbar nav > a img { width: 15px; height: 15px; }
  .nav-label { display: none; }
  .workspace .nav-form { grid-column: 1 / -1; padding-top: 12px; margin-top: 8px; }
  .workspace .page { margin-left: 0; padding: 24px 18px 50px; }
  .workspace-heading { align-items: flex-start; }
  .workspace-heading h1 { font-size: 20px; }
  .binding-strip { padding: 14px; gap: 10px; }
  .binding-strip button { padding: 8px 10px; font-size: 11px; flex-shrink: 0; }
  .workspace-heading time { font-size: 10px; margin-top: 4px; }
  .student-picker { justify-content: flex-start; }
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 16px 12px; min-height: 125px; }
  .metric-icon { position: static; width: 26px; height: 26px; margin-bottom: 12px; }
  .metric-icon img { width: 15px; height: 15px; }
  .metric .label { font-size: 10px; }
  .metric strong { font-size: 23px; margin-top: 9px; }
  .checkin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .checkin-image { aspect-ratio: 1; }
  .checkin-meta { align-items: flex-start; flex-direction: column; font-size: 10px; padding: 8px 6px; gap: 7px; }
  .checkin-meta .status { font-size: 9px; padding: 4px; }
  .section-head { flex-direction: row; align-items: center; }
  .section-head h1 { font-size: 17px; }
  .section-head .muted { max-width: 45%; text-align: right; }
  .two-column { grid-template-columns: 1fr; }
  .form-grid textarea, .form-grid .check { grid-column: auto; }
  .login-panel { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
