:root {
  --bg: #eef2f6;
  --bg-soft: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #f5f7fa;
  --surface-muted: #eff3f8;
  --line: #dbe2ea;
  --line-strong: #c8d2de;
  --text: #111827;
  --text-soft: #5b6677;
  --text-faint: #8b95a5;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: rgba(37, 99, 235, 0.1);
  --success: #1f8a52;
  --success-soft: rgba(31, 138, 82, 0.12);
  --warn: #a76b18;
  --warn-soft: rgba(167, 107, 24, 0.12);
  --danger: #c2414c;
  --danger-strong: #a7323c;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 36px rgba(15, 23, 42, 0.08);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-body: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.icp-footer { padding: 14px 16px max(20px, env(safe-area-inset-bottom)); text-align: center; font-size: 13px; color: #586577; }
.icp-footer a { color: inherit; text-decoration: none; }
.icp-footer a:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, #f9fbfd 0%, var(--bg) 100%);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button,
input,
select {
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 1px var(--brand),
    0 0 0 4px rgba(37, 99, 235, 0.14);
}

.staff-login-shell {
  min-height: 100dvh;
  width: min(100%, 480px);
  margin: 0 auto;
  padding: clamp(76px, 15vh, 136px) 36px 40px;
  background: #ffffff;
  isolation: isolate;
}

.staff-login-shell::before,
.staff-login-shell::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

.staff-login-shell::before {
  top: 0;
  left: 0;
  width: min(78vw, 760px);
  height: min(62vh, 640px);
  background: linear-gradient(135deg, rgba(229, 239, 255, 0.88), rgba(247, 250, 255, 0.1));
  clip-path: polygon(0 0, 100% 0, 62% 42%, 0 58%);
}

.staff-login-shell::after {
  top: 0;
  right: 0;
  width: min(62vw, 610px);
  height: min(52vh, 520px);
  background: linear-gradient(145deg, rgba(223, 235, 255, 0.74), rgba(248, 251, 255, 0));
  clip-path: polygon(36% 0, 100% 0, 100% 78%, 0 38%);
}

.staff-login-brand,
.staff-login-card .panel-section,
.panel-section,
.student-card,
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.staff-login-brand {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.staff-logo-mark {
  color: var(--brand);
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.staff-login-brand h1 {
  margin: 0;
  color: #2874ee;
  display: grid;
  justify-items: center;
  gap: 4px;
  line-height: 1.15;
  letter-spacing: 0;
}

.staff-login-title-main {
  font-size: 28px;
  font-weight: 800;
}

.staff-login-title-sub {
  font-size: 16px;
  font-weight: 600;
}

.staff-login-brand p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
  font-size: 14px;
}

.staff-login-card {
  width: min(100%, 363px);
  margin: clamp(92px, 16vh, 156px) auto 0;
}

.staff-login-card .panel-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.staff-login-shell .staff-form {
  gap: 28px;
}

.staff-login-shell .field {
  gap: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.staff-login-shell .staff-input {
  min-height: 60px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid #e6e8ed;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  line-height: 1.4;
}

.staff-login-shell .staff-input::placeholder {
  color: #a8adb7;
}

.staff-login-shell .staff-input:focus-visible {
  border-bottom-color: #2b73e8;
  box-shadow: 0 2px 0 -1px #2b73e8;
}

.staff-login-shell .staff-btn {
  min-height: 41px;
  height: 41px;
  margin-top: 62px;
  border: 0;
  border-radius: 999px;
  background: #8baff0;
  box-shadow: none;
  font-size: 15px;
  font-weight: 500;
}

.staff-login-shell .staff-btn:hover {
  background: #5d91ed;
}

.staff-login-shell .staff-btn:active {
  transform: scale(0.99);
}

.panel-section {
  padding: 18px;
}

.compact-panel {
  padding: 18px;
}

.date-panel {
  padding: 18px 18px 16px;
}

.current-date-label {
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.staff-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clock-flow-header {
  justify-content: flex-start;
}

.staff-header.clock-flow-header {
  min-height: 72px;
  padding: 14px 28px 12px;
  align-items: center;
}

.clock-back-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
}

.clock-back-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.clock-confirm-card {
  text-align: left;
}

.clock-confirm-card h3 {
  margin-top: 0;
}

.clock-main {
  display: grid;
  gap: 16px;
}

.clock-overview {
  padding: 24px;
  background: linear-gradient(145deg, #f9fbff, #ffffff);
}

.clock-eyebrow {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.clock-overview h2,
.clock-success h2,
.clock-page-head h2 {
  margin: 8px 0 6px;
  font-size: 24px;
}

.clock-overview p,
.clock-success p {
  margin: 0;
  color: var(--text-soft);
}

.clock-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.clock-times div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.clock-times span {
  color: var(--text-faint);
  font-size: 12px;
}

.clock-times strong {
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.clock-warning {
  padding: 13px 15px;
  border: 1px solid rgba(167, 107, 24, 0.24);
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: #765014;
  font-size: 14px;
  line-height: 1.5;
}

.clock-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.clock-action-button {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.clock-action-button.check-in {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(37, 99, 235, 0.06);
}

.clock-action-button.check-out {
  border-color: rgba(31, 138, 82, 0.22);
  background: var(--success-soft);
}

.clock-action-button span {
  font-size: 18px;
  font-weight: 750;
}

.clock-action-button small {
  color: var(--text-soft);
  font-size: 13px;
}

.clock-action-button:not(:disabled):active {
  transform: scale(0.98);
}

.clock-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.clock-records-link {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--brand);
  font-weight: 700;
}

.clock-success {
  display: grid;
  gap: 14px;
  padding: 30px 22px;
  text-align: center;
}

.clock-success-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 2px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 32px;
  font-weight: 800;
}

.clock-note-field {
  margin-top: 8px;
  text-align: left;
}

.clock-note-field .staff-input {
  min-height: 104px;
  padding: 12px;
  resize: vertical;
}

.clock-complete {
  width: 100%;
  margin-top: 4px;
}

.clock-record-panel {
  padding: 22px;
}

.clock-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clock-page-head h2 {
  margin: 0;
}

.clock-record-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 16px 0 18px;
}

.clock-record-date-trigger {
  width: 100%;
  min-height: 44px;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clock-record-filter-divider {
  color: var(--text-soft);
  font-size: 13px;
}

.clock-record-filter-submit {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: #d6dbe4;
  color: #8b94a3;
  font-weight: 700;
}

.clock-record-filter-submit.active {
  background: var(--brand);
  color: #fff;
}

.clock-record-filter-submit:disabled {
  cursor: not-allowed;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.clock-date-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.4);
}

.clock-date-picker {
  position: fixed;
  z-index: 81;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: min(760px, 90dvh);
  overflow: auto;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.2);
}

.clock-date-picker-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: #d7dde7;
}

.clock-date-picker-head,
.clock-date-picker-month,
.clock-date-picker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clock-date-picker-head h3,
.clock-date-picker-head p {
  margin: 0;
}

.clock-date-picker-head h3 {
  color: var(--text);
  font-size: 20px;
}

.clock-date-picker-head p {
  margin-top: 5px;
  color: var(--text-soft);
  font-size: 13px;
}

.clock-date-picker-close,
.clock-date-picker-month button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 32px;
  line-height: 1;
}

.clock-date-picker-month {
  margin-top: 20px;
}

.clock-date-picker-month strong {
  color: var(--text);
  font-size: 19px;
}

.clock-date-picker-weekdays,
.clock-date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}

.clock-date-picker-weekdays {
  margin: 16px 0 6px;
  color: var(--text-soft);
  font-size: 13px;
}

.clock-date-picker-days button,
.clock-date-picker-days > span {
  min-width: 0;
  aspect-ratio: 1;
}

.clock-date-picker-days button {
  position: relative;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.clock-date-picker-days button:disabled {
  color: #c6ccd6;
}

.clock-date-picker-days button.in-range {
  border-radius: 0;
  background: #dbeafe;
  color: var(--brand-strong);
}

.clock-date-picker-days button.range-start,
.clock-date-picker-days button.range-end {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.clock-date-picker-shortcuts {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.clock-date-picker-shortcuts button {
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
}

.clock-date-picker-actions {
  margin-top: 16px;
}

.clock-date-picker-actions button {
  min-height: 48px;
  flex: 1;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
}

.clock-date-picker-reset {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.clock-date-picker-confirm {
  border: 0;
  background: var(--brand);
  color: #fff;
}

.clock-record-list {
  display: grid;
  gap: 12px;
}

.clock-record-day-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.clock-record-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.clock-record-day-head strong {
  color: var(--text);
  font-size: 15px;
}

.clock-record-day-head span,
.clock-record-times span {
  color: var(--text-soft);
  font-size: 13px;
}

.clock-record-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clock-record-times > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
}

.clock-record-times > div + div {
  border-left: 1px solid var(--line);
}

.clock-record-times strong {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.clock-record-load-state {
  padding: 18px 6px 4px;
  color: var(--text-soft);
  font-size: 13px;
  text-align: center;
}

.staff-brand { position: relative; }
.staff-campus-trigger { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.staff-campus-menu { position: absolute; z-index: 20; top: 30px; left: 0; min-width: 180px; padding: 6px; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.staff-campus-menu button { display: block; width: 100%; padding: 9px 10px; border: 0; background: transparent; text-align: left; color: var(--text); }
.staff-campus-menu button.current { color: var(--text-soft); cursor: default; }
.staff-campus-menu em { color: var(--primary); font-style: normal; font-size: 12px; }

.staff-empty-campus { margin: 18px 0 0; }

@media (max-width: 420px) {
  .staff-main { overflow-x: clip; }
  .attendance-summary-row { gap: 10px; }
  .attendance-counts { min-width: 0; font-size: 14px; white-space: nowrap; }
  .lesson-type-chip { min-width: 0; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 360px) {
  .clock-actions,
  .clock-times {
    grid-template-columns: 1fr;
  }
}

.class-picker-panel {
  position: relative;
  z-index: 10;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head.compact {
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.24;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.staff-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.class-picker-field {
  position: relative;
  z-index: 30;
}

.field label,
.field > span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.staff-input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
}

.staff-input::placeholder {
  color: var(--text-faint);
}

.large-select {
  min-height: 54px;
  font-size: 16px;
}

.class-picker {
  position: relative;
}

.class-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.class-picker-trigger span:first-child {
  min-width: 0;
  flex: 1;
  font-weight: 600;
  color: var(--text);
}

.class-picker-caret {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-right: 2px solid var(--text-soft);
  border-bottom: 2px solid var(--text-soft);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.class-picker-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
}

.class-picker-sheet {
  position: fixed;
  z-index: 81;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  height: min(76dvh, 700px);
  min-height: 48dvh;
  max-height: min(76dvh, 700px);
  padding: 10px 18px calc(16px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: 0 -18px 50px rgba(15, 23, 42, 0.22);
  animation: class-picker-sheet-enter 200ms ease-out;
}

.class-picker-sheet.keyboard-open {
  bottom: var(--class-picker-keyboard-inset, 0px);
  height: min(76dvh, 700px, var(--class-picker-available-height, 100dvh));
  min-height: 0;
  max-height: var(--class-picker-available-height, 100dvh);
}

.class-picker-sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: var(--line-strong);
}

.class-picker-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.class-picker-sheet-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.class-picker-sheet-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-soft);
  font-size: 28px;
  line-height: 1;
}

.class-picker-search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  margin: 12px 0;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.class-picker-search svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--text-soft);
  stroke-linecap: round;
  stroke-width: 2;
}

.class-picker-search input {
  display: block;
  width: 100%;
  height: 46px;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 46px;
}

.class-picker-sheet-list {
  display: grid;
  flex: 1;
  min-height: 0;
  align-content: start;
  grid-auto-rows: min-content;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 0;
}

.class-picker-sheet-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}

.class-picker-sheet-option.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.class-picker-sheet-option svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.class-picker-search-empty {
  align-self: center;
  padding: 28px 12px;
  color: var(--text-soft);
  text-align: center;
}

@keyframes class-picker-sheet-enter {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

.staff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--brand);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.staff-btn:hover {
  background: var(--brand-strong);
}

.staff-btn:active {
  transform: scale(0.98);
}

.staff-btn.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}

.staff-btn.secondary:hover {
  background: var(--surface-soft);
}

.staff-btn.danger {
  background: var(--danger);
  box-shadow: 0 10px 24px rgba(194, 65, 76, 0.18);
}

.staff-btn.danger:hover {
  background: var(--danger-strong);
}

.staff-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.text-btn {
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-soft);
}

.text-btn:hover {
  color: var(--text);
}

.staff-shell {
  min-height: 100vh;
  width: min(100%, 460px);
  margin: 0 auto;
}

.staff-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.logo {
  min-width: 0;
  font-size: 21px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
}

.logout-badge:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.staff-main.simple {
  padding: 12px;
  display: grid;
  gap: 12px;
}

.class-meta {
  margin-top: 10px;
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 13px;
}

.class-meta strong {
  color: var(--text);
}

.student-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.student-card {
  padding: 16px;
}

.student-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.student-info {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 4px;
  align-items: center;
}

.student-info::before {
  content: "";
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid #d6deea;
  background:
    radial-gradient(circle at 50% 33%, #b8c3d4 0 10px, transparent 11px),
    radial-gradient(ellipse at 50% 87%, #c3cedd 0 18px, transparent 19px),
    linear-gradient(180deg, #f9fbfe 0%, #eef3f8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.student-title-row {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.student-name {
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.02em;
}

.student-summary {
  grid-column: 2;
  margin-top: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.signed {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(31, 138, 82, 0.16);
}

.status-badge.unsigned {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: rgba(167, 107, 24, 0.16);
}

.student-card-actions {
  flex: 0 0 auto;
}

.student-action-stack {
  display: grid;
  gap: 8px;
}

.compact-btn {
  min-width: 118px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 15px;
}

.compact-btn-secondary {
  box-shadow: none;
}

.student-action-menu-wrap {
  position: relative;
}

.student-action-menu-toggle {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0 0 8px;
  border-radius: 8px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.student-action-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 116px;
  overflow: hidden;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(33, 45, 67, 0.16);
  transform-origin: top right;
  animation: student-action-menu-enter 160ms ease-out both;
}

.student-action-menu.is-up {
  top: auto;
  bottom: calc(100% + 6px);
  transform-origin: bottom right;
}

.student-action-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid #edf0f4;
  background: #ffffff;
  color: #2e3748;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.student-action-menu button:last-child {
  border-bottom: 0;
}

.student-action-menu button:hover,
.student-action-menu button:focus-visible,
.student-action-menu button:active {
  background: #f2f7fc;
  outline: none;
}

.student-action-menu-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

@keyframes student-action-menu-enter {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.student-action-menu.is-up {
  animation-name: student-action-menu-enter-up;
}

@keyframes student-action-menu-enter-up {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Teacher attendance dashboard: a compact, touch-first operational layout. */
.staff-shell {
  background: #ffffff;
}

.staff-header {
  position: relative;
  min-height: 138px;
  padding: 28px 38px 22px;
  align-items: flex-start;
  background: #ffffff;
  backdrop-filter: none;
}

.staff-header:not(.clock-flow-header)::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 18%;
  width: 46%;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0), rgba(96, 165, 250, 0.72) 28%, #2563eb 55%, rgba(59, 130, 246, 0) 100%);
}

.staff-brand {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.staff-brand strong {
  color: #111827;
  font-size: 28px;
  font-weight: 760;
  line-height: 1.12;
  letter-spacing: 0;
}

.staff-brand span {
  color: var(--text-soft);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.staff-header-actions {
  gap: 12px;
  padding-top: 2px;
}

.header-clock-button,
.user-menu-trigger {
  min-height: 48px;
  border: 1px solid #d8e0ec;
  background: #ffffff;
  color: var(--brand);
}

.header-clock-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
}

.header-clock-button svg,
.user-menu-trigger svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.user-menu-trigger svg {
  color: #525c6d;
}

.staff-user-menu {
  position: relative;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 62px;
  padding: 0 14px;
  border-radius: 999px;
}

.user-menu-caret {
  width: 9px;
  height: 9px;
  border-right: 2px solid #7c8697;
  border-bottom: 2px solid #7c8697;
  transform: rotate(45deg) translateY(-2px);
}

.user-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  min-width: 116px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.user-menu-popover button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 12px;
}

.user-menu-popover button:hover,
.user-menu-popover button:focus-visible {
  background: var(--surface-soft);
}

.staff-main.simple {
  gap: 30px;
  padding: 34px 38px 42px;
}

.staff-main.clock-main {
  gap: 14px;
  padding: 18px;
}

.date-panel {
  padding: 0;
}

.current-date-label {
  color: #4e596b;
  font-size: 19px;
  font-weight: 550;
  letter-spacing: 0;
}

.class-picker-panel {
  z-index: 10;
  margin-top: -10px;
}

.large-select {
  min-height: 64px;
  padding: 0 20px;
  border-radius: 14px;
  background: #ffffff;
  font-size: 22px;
}

.class-picker-trigger span:first-child {
  font-weight: 720;
}

.attendance-summary {
  padding: 22px 24px;
  border: 1px solid #dfe6f0;
  border-radius: 18px;
  background: #ffffff;
}

.attendance-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.attendance-counts {
  min-width: 0;
  color: #1f2937;
  font-size: 18px;
  line-height: 1.5;
  white-space: nowrap;
}

.attendance-counts strong {
  color: #111827;
  font-size: 21px;
}

.attendance-counts .pending {
  color: #bf6a00;
}

.attendance-counts .complete {
  color: var(--success);
}

.attendance-counts span {
  color: #a6afbd;
  margin: 0 4px;
}

.lesson-type-chip {
  flex: 0 0 auto;
  max-width: 42%;
  overflow: hidden;
  padding: 9px 12px;
  border: 1px solid #d8e0ec;
  border-radius: 10px;
  color: #6b778a;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-list {
  gap: 18px;
  margin-top: 2px;
}

.student-card {
  padding: 22px;
  border-radius: 18px;
  box-shadow: none;
}

.student-card-main {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.student-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
}

.student-info {
  display: grid;
  min-width: 0;
  grid-template-columns: 1fr;
  gap: 6px;
}

.student-info::before {
  display: none;
}

.student-name {
  font-size: 24px;
  font-weight: 760;
  letter-spacing: 0;
}

.student-summary {
  grid-column: auto;
  margin-top: 0;
  color: #748095;
  font-size: 16px;
}

.student-card-actions {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.status-badge {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
}

.status-badge.unsigned {
  color: #bf6a00;
  background: transparent;
}

.status-badge.signed {
  color: var(--success);
  background: transparent;
}

.status-badge.unavailable {
  color: #dc2626;
}

.compact-btn {
  min-width: 118px;
  min-height: 46px;
  border-radius: 8px;
  font-size: 18px;
}

.compact-btn:disabled {
  opacity: 1;
  border-color: #d7dce5;
  background: #f3f4f6;
  color: #7b8494;
}

.student-unavailable-note {
  margin: 16px 0 0 74px;
  color: #dc2626;
  font-size: 14px;
  line-height: 1.5;
}

.view-enter-forward,
.view-enter-back,
.view-exit-left,
.view-exit-right {
  will-change: transform, opacity;
}

.view-enter-forward {
  animation: staff-view-enter-forward 220ms ease-out both;
}

.view-enter-back {
  animation: staff-view-enter-back 220ms ease-out both;
}

.view-exit-left {
  animation: staff-view-exit-left 170ms ease-in both;
  pointer-events: none;
}

.view-exit-right {
  animation: staff-view-exit-right 170ms ease-in both;
  pointer-events: none;
}

@keyframes staff-view-enter-forward {
  from { opacity: 0.42; transform: translateX(36px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes staff-view-enter-back {
  from { opacity: 0.42; transform: translateX(-36px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes staff-view-exit-left {
  to { opacity: 0.25; transform: translateX(-28px); }
}

@keyframes staff-view-exit-right {
  to { opacity: 0.25; transform: translateX(28px); }
}

.empty-inline {
  padding: 24px 18px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-soft);
  line-height: 1.7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(6px);
  z-index: 40;
}

.modal-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}

.modal-card {
  width: min(420px, 100%);
  padding: 22px 18px;
}

.modal-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
  font-size: 14px;
}

.modal-note {
  margin-top: 10px !important;
}

.modal-field {
  margin-top: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions.vertical {
  display: grid;
}

.modal-actions .staff-btn {
  flex: 1;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 18px;
  z-index: 70;
  padding: 14px 16px;
  border-radius: 16px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.toast.info {
  background: #1f2937;
}

.toast.success {
  background: #17643d;
}

.toast.error {
  background: #a7323c;
}

@media (min-width: 520px) {
  .staff-header {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
  }

  .staff-main.simple {
    padding: 16px 0 24px;
  }

  .toast {
    left: 50%;
    right: auto;
    width: min(420px, calc(100vw - 32px));
    transform: translateX(-50%);
  }
}

@media (max-width: 640px) {
  .staff-login-shell {
    padding: clamp(64px, 14vh, 112px) 28px 32px;
  }

  .staff-login-card {
    margin-top: clamp(80px, 15vh, 128px);
  }

  .staff-login-shell .staff-btn {
    min-height: 44px;
    height: 44px;
    margin-top: 52px;
  }

  .staff-header {
    padding: 12px 14px;
  }

  .logo {
    font-size: 19px;
  }

  .badge {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

  .panel-section,
  .compact-panel {
    padding: 15px;
    border-radius: 20px;
  }

  .date-panel {
    padding: 16px 15px 14px;
  }

  .current-date-label {
    font-size: 18px;
  }

  .large-select {
    min-height: 50px;
    font-size: 15px;
  }

  .student-card {
    padding: 14px;
    border-radius: 18px;
  }

  .student-card-main {
    gap: 10px;
  }

  .student-info {
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 10px;
  }

  .student-info::before {
    width: 44px;
    height: 44px;
  }

  .student-name {
    font-size: 16px;
  }

  .student-summary {
    font-size: 13px;
  }

  .compact-btn {
    min-width: 96px;
    min-height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }

  .student-action-menu-toggle {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    font-size: 25px;
  }
}

@media (min-width: 520px) {
  .staff-main.simple {
    padding: 34px 38px 42px;
  }

  .staff-main.clock-main {
    gap: 14px;
    padding: 16px 18px 28px;
  }
}

@media (max-width: 640px) {
  .staff-header {
    min-height: 96px;
    padding: 17px 18px 14px;
  }

  .staff-header.clock-flow-header {
    min-height: 64px;
    padding: 10px 18px;
  }

  .staff-brand strong {
    font-size: 21px;
  }

  .staff-brand span {
    font-size: 13px;
  }

  .staff-header-actions {
    gap: 8px;
  }

  .header-clock-button {
    min-height: 44px;
    padding: 0 11px;
    font-size: 13px;
  }

  .header-clock-button svg,
  .user-menu-trigger svg {
    width: 20px;
    height: 20px;
  }

  .user-menu-trigger {
    min-height: 44px;
    min-width: 52px;
    padding: 0 10px;
  }

  .staff-main.simple {
    gap: 12px;
    padding: 10px 18px 28px;
  }

  .date-panel {
    min-height: 25px;
    padding: 2px 3px;
  }

  .current-date-label {
    color: #7d8796;
    font-size: 15px;
    font-weight: 500;
  }

  .class-picker-panel {
    margin-top: -4px;
  }

  .large-select {
    min-height: 56px;
    padding: 0 16px;
    font-size: 16px;
  }

  .attendance-summary {
    min-height: 47px;
    padding: 4px 18px;
    border-radius: 16px;
  }

  .attendance-summary-row {
    gap: 10px;
  }

  .attendance-counts {
    font-size: 15px;
  }

  .attendance-counts strong {
    font-size: 17px;
  }

  .lesson-type-chip {
    max-width: 34%;
    padding: 8px 10px;
    font-size: 13px;
  }

  .student-list {
    gap: 14px;
  }

  .student-card {
    padding: 18px 16px;
    border-radius: 16px;
  }

  .student-card-main {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 12px;
  }

  .student-avatar {
    width: 48px;
    height: 48px;
  }

  .student-info {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  .student-info::before {
    display: none;
  }

  .student-name {
    font-size: 19px;
  }

  .student-summary,
  .status-badge {
    font-size: 13px;
  }

  .student-card-actions {
    gap: 8px;
  }

  .compact-btn {
    min-width: 88px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
  }

  .student-action-menu-toggle {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .student-unavailable-note {
    margin: 12px 0 0 60px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
