:root {
  color-scheme: light;
  font-family: "Inter", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: #192d25;
  background: #f7f7f1;
  --ink: #192d25;
  --muted: #4c6358;
  --line: #dce4da;
  --green: #204c39;
  --paper: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea { min-height: 44px; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #55935d; outline-offset: 3px; }
a { color: var(--green); }
h1, h2, h3, p, dl { margin: 0; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); line-height: 1.14; letter-spacing: -.045em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; overflow-wrap: anywhere; }
p { line-height: 1.55; }

.topbar { border-bottom: 1px solid var(--line); background: #fbfcf8; }
.top-inner {
  min-height: 68px;
  max-width: 960px;
  margin: auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand strong { font-size: 1.2rem; letter-spacing: .08em; }
.brand-label { color: var(--muted); font-size: .85rem; padding-left: 4px; }
.mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: var(--green);
}
.mark::before {
  content: "";
  width: 52%;
  height: 52%;
  border: 2px solid #e3f1cf;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #e3f1cf 25%, transparent 25%);
}
.mark.large { width: 48px; height: 48px; border-radius: 14px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.identity { max-width: 11ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.demo-label { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.text-button { color: var(--green); background: transparent; border: 0; padding: 0 4px; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }

.shell { max-width: 960px; margin: auto; padding: 54px 24px 56px; }
.card, .records {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
}
.login { max-width: 420px; margin: 20px auto; padding: 32px; }
.login h1 { margin: 16px 0 22px; font-size: 1.8rem; }
.login > p { margin: -8px 0 20px; color: var(--muted); }
.demo-options { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: .85rem; }
.demo-options button { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; color: var(--green); background: #f4f8f2; }
.primary, .secondary {
  border-radius: 10px;
  padding: 8px 15px;
  font-weight: 650;
  border: 1px solid transparent;
}
.primary { color: #fff; background: var(--green); }
.primary:hover { background: #163e2d; }
.secondary { color: var(--green); border-color: #c9d9ce; background: #fff; }
.secondary:hover { background: #f0f6ee; }
.full { width: 100%; }
.plus { font-size: 1.08em; }

.page-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 24px; }
.page-head > button { flex: none; }
.eyebrow { font-size: .92rem; color: var(--muted); margin-bottom: 6px; }
.back { margin-bottom: 2px; padding-left: 0; }
.metrics { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.metric {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px 18px;
  min-width: 0;
  background: #edf2e9;
  border-radius: 15px;
  color: var(--muted);
  font-size: .88rem;
}
.metric:first-child { background: #dfecd9; }
.metric strong { color: var(--ink); font-size: clamp(1.06rem, 3.4vw, 1.55rem); font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.metric small { font-size: .8rem; font-weight: 500; }
.records-head { padding: 20px 22px 12px; display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.filters > * { max-width: 100%; }
.tabs { display: flex; padding: 0 22px 13px; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-radius: 9px; padding: 7px 13px; color: var(--muted); background: transparent; }
.tabs button[aria-pressed="true"] { color: var(--green); font-weight: 700; background: #e8f0e5; }
.entry, .person { display: flex; justify-content: space-between; gap: 12px; padding: 16px 22px; }
.entry + .entry, .person + .person { border-top: 1px solid var(--line); }
.staff-person { align-items: center; flex-wrap: wrap; }
.staff-person span { display: block; margin-top: 3px; }
.staff-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.entry-main { min-width: 0; }
.entry-top { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 4px; }
.entry-date, .entry-note, .locked, .person span { color: var(--muted); font-size: .84rem; }
.entry-note, .return-reason, .person { overflow-wrap: anywhere; }
.shift-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.shift-time small { font-size: .78em; font-weight: 500; color: var(--muted); }
.badge { padding: 3px 8px; border-radius: 99px; font-size: .75rem; white-space: nowrap; }
.badge.approved { color: #1d532d; background: #e3f1dd; }
.badge.pending { color: #664818; background: #f7edcf; }
.badge.returned { color: #7b302b; background: #fce7e4; }
.return-reason { margin-top: 4px; color: #7b302b; font-size: .87rem; }
.entry-side { display: flex; flex-direction: column; align-items: end; flex: none; gap: 4px; }
.entry-side > strong { font-size: .92rem; margin-bottom: 3px; }
.review-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.empty { padding: 28px 20px; color: var(--muted); text-align: center; }
.empty button { margin-top: 12px; }

label { display: block; font-weight: 650; font-size: .94rem; }
form label { margin-bottom: 13px; }
input, select, textarea {
  border: 1px solid #c8d5ca;
  border-radius: 9px;
  background: #fff;
  padding: 8px 10px;
  color: var(--ink);
}
form input:not([type="checkbox"]), textarea { display: block; width: 100%; min-width: 0; margin-top: 5px; font-size: 1rem; }
textarea { resize: vertical; }
.form-error { color: #9a3027; font-size: .9rem; margin: 0 0 12px; }
.form-error:empty, .duration:empty { display: none; }
.field-help, .optional { color: var(--muted); font-size: .82rem; font-weight: 400; }
.field-help { margin: -6px 0 14px; }
.time-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
form .checkbox { display: flex; gap: 8px; align-items: center; min-height: 44px; margin-bottom: 6px; width: fit-content; }
.checkbox input { min-height: auto; width: 20px; height: 20px; margin: 0; accent-color: var(--green); }
.duration { display: block; color: var(--green); font-size: .92rem; margin-bottom: 12px; }

dialog { border: 1px solid var(--line); border-radius: 20px; color: var(--ink); padding: 24px; width: min(460px, calc(100% - 26px)); max-height: calc(100% - 26px); }
dialog::backdrop { background: #15281f88; }
dialog h2 { font-size: 1.45rem; margin-bottom: 16px; }
dialog .review-summary { padding: 12px; background: #edf2e9; border-radius: 10px; margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: end; gap: 8px; margin-top: 18px; }
.credentials { padding: 10px 12px; margin: 12px 0; background: #edf2e9; border-radius: 10px; }
.credentials dt { color: var(--muted); font-size: .82rem; }
.credentials dd { margin: 0 0 6px; font-weight: 650; overflow-wrap: anywhere; }
#notice:not(:empty) { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 560px) {
  .shell { padding: 28px 14px 40px; }
  .top-inner { min-height: 58px; padding: 6px 14px; }
  .brand-label, .identity { display: none; }
  .top-actions { gap: 6px; }
  .login { margin: 12px auto; padding: 23px; }
  .page-head { margin-bottom: 18px; }
  .metrics { gap: 6px; margin-bottom: 18px; }
  .metric { padding: 12px 8px; font-size: .8rem; }
  .records-head, .entry, .person { padding-left: 12px; padding-right: 12px; }
  .tabs { padding-left: 8px; padding-right: 8px; gap: 0; }
  .tabs button { padding-left: 10px; padding-right: 10px; font-size: .9rem; }
  .entry { gap: 7px; }
  .review-actions > button { padding: 6px 9px; font-size: .9rem; }
  .filters input, .filters select { font-size: 1rem; }
}
