/* ============================================================
   小米考勤 · Component Library
   Adapted from HIIUI Pro (desktop) + 移动端常用元件库 for touch UI.
   Naming: .c-* components, .btn/.card/.list generic surfaces.
   ============================================================ */

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-card);
}
.card--pad { padding: 16px; }
.card--sm { border-radius: var(--r-m); }
.card--flat { box-shadow: none; border-color: var(--line); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.card-title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 7px; }
.card-title .icon { width: 18px; height: 18px; color: var(--brand); }
.card-more {
  display: inline-flex; align-items: center; gap: 1px;
  font-size: 12px; color: var(--text-3); font-weight: 500;
  padding: 4px 0 4px 6px; border-radius: 8px;
}
.card-more .icon { width: 14px; height: 14px; }
.card-more:active { color: var(--brand); }

/* ---------- Section header ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 22px 2px 10px;
}
.section-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.section-sub { font-size: 12px; color: var(--text-3); margin-left: 7px; font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 44px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; height: var(--btn-h); padding: 0 18px;
  border-radius: var(--r-m);
  font-size: 15px; font-weight: 600; letter-spacing: .01em;
  color: var(--text-1); background: var(--bg-2);
  transition: transform var(--dur-1) var(--ease-out), opacity var(--dur-1), background var(--dur-1), box-shadow var(--dur-2);
  user-select: none; white-space: nowrap;
}
.btn:active { transform: scale(.975); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }
.btn--primary {
  color: #fff; background: var(--brand);
  box-shadow: 0 6px 16px -8px rgba(22, 119, 255, .7);
}
.btn--primary:active { background: var(--brand-600); }
.btn--gradient {
  color: #fff; background: var(--brand-grad);
  box-shadow: var(--brand-glow);
}
.btn--soft { color: var(--brand-600); background: var(--brand-100); }
.btn--outline { color: var(--text-1); background: transparent; border: 1px solid var(--line); }
.btn--ghost { color: var(--text-2); background: transparent; }
.btn--danger { color: #fff; background: var(--danger); box-shadow: 0 6px 16px -8px rgba(245, 63, 63, .7); }
.btn--danger-soft { color: var(--danger); background: var(--danger-soft); }
.btn--success { color: #fff; background: var(--success); box-shadow: 0 6px 16px -8px rgba(0, 180, 42, .6); }
.btn--white { color: var(--brand-600); background: #fff; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .35); }
.btn--sm { --btn-h: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; gap: 5px; }
.btn--sm .icon { width: 15px; height: 15px; }
.btn--lg { --btn-h: 50px; font-size: 16px; border-radius: 14px; }
.btn--block { display: flex; width: 100%; }
.btn--icon { width: var(--btn-h); padding: 0; border-radius: 50%; }
.btn--pill { border-radius: var(--r-full); }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn-label { opacity: .65; }
.btn .spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff; animation: spin .8s linear infinite;
}
.btn--soft .spinner, .btn--ghost .spinner { border-color: rgba(22, 119, 255, .25); border-top-color: var(--brand); }

/* ---------- Tags / status ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px;
  border-radius: 6px;
  font-size: 11px; font-weight: 600; line-height: 1;
  color: var(--text-2); background: var(--bg-2);
  white-space: nowrap; flex: none;
}
.tag .icon { width: 11px; height: 11px; stroke-width: 2.4; }
.tag--lg { height: 24px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.tag--blue { color: var(--brand-600); background: var(--brand-100); }
.tag--green { color: var(--success-deep); background: var(--success-soft); }
.tag--orange { color: var(--warning-deep); background: var(--warning-soft); }
.tag--red { color: var(--danger-deep); background: var(--danger-soft); }
.tag--purple { color: var(--purple); background: var(--purple-soft); }
.tag--cyan { color: #0b9e9b; background: var(--cyan-soft); }
.tag--gray { color: var(--text-3); background: var(--bg-2); }
.tag--outline { background: transparent; border: 1px solid var(--line); color: var(--text-2); }
.tag--solid { color: #fff; background: var(--brand); }
.tag--dot::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; flex: none; opacity: .9;
}

.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 7px;
  font-size: 12px; font-weight: 600;
}
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.is-normal { color: var(--success-deep); background: var(--success-soft); }
.status-pill.is-late { color: var(--warning-deep); background: var(--warning-soft); }
.status-pill.is-missing { color: var(--danger-deep); background: var(--danger-soft); }
.status-pill.is-leave { color: var(--brand-600); background: var(--brand-100); }
.status-pill.is-rest { color: var(--text-3); background: var(--bg-2); }
.status-pill.is-early { color: var(--warning-deep); background: var(--warning-soft); }

/* ---------- Avatar ---------- */
.avatar {
  --av: 40px; --h: 214;
  width: var(--av); height: var(--av); flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: calc(var(--av) * .36); font-weight: 650; color: #fff;
  letter-spacing: .02em;
  background: linear-gradient(140deg, hsl(var(--h) 85% 66%), hsl(var(--h) 74% 48%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
  overflow: hidden; position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--xs { --av: 26px; }
.avatar--sm { --av: 32px; }
.avatar--md { --av: 44px; }
.avatar--lg { --av: 56px; }
.avatar--xl { --av: 72px; }
.avatar--rounded { border-radius: 30%; }
.avatar--ring { box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--brand-200); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--card); }
.avatar-stack .avatar + .avatar { margin-left: -9px; }
.avatar-wrap { position: relative; flex: none; }
.avatar-state {
  position: absolute; right: -1px; bottom: -1px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--card); background: var(--success);
}
.avatar-state.is-late { background: var(--warning); }
.avatar-state.is-leave, .avatar-state.is-out { background: var(--brand); }
.avatar-state.is-off { background: var(--text-4); }

/* ---------- Badge / dot ---------- */
.badge {
  display: inline-grid; place-items: center;
  min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; font-style: normal;
  font-family: var(--font-num);
}
.badge--dot { min-width: 8px; width: 8px; height: 8px; padding: 0; border-radius: 50%; }
.badge--blue { background: var(--brand); }
.badge--orange { background: var(--mi-orange); }
.dot-live {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 3px rgba(0, 180, 42, .14);
}

/* ---------- Segmented control ---------- */
.seg {
  display: flex; gap: 2px; padding: 3px;
  background: var(--bg-2); border-radius: 11px;
}
.seg button {
  flex: 1; height: 32px; border-radius: 8px;
  font-size: 13px; font-weight: 550; color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: all var(--dur-2) var(--ease-out);
}
.seg button.is-active {
  background: var(--card); color: var(--text-1); font-weight: 650;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .10), 0 1px 1px rgba(15, 23, 42, .04);
}
.seg--brand button.is-active { color: var(--brand-600); }
.seg--sm button { height: 27px; font-size: 12px; }
.seg-count {
  font-size: 10px; font-weight: 700; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px; background: var(--line); color: var(--text-2);
  display: inline-grid; place-items: center;
}
.seg button.is-active .seg-count { background: var(--brand-100); color: var(--brand-600); }

/* ---------- Underline tabs ---------- */
.tabs {
  display: flex; gap: 22px;
  border-bottom: 1px solid var(--line-2);
  position: relative;
}
.tabs .tab {
  position: relative; height: 42px;
  font-size: 14px; font-weight: 550; color: var(--text-3);
  display: inline-flex; align-items: center; gap: 5px;
  transition: color var(--dur-1);
}
.tabs .tab.is-active { color: var(--text-1); font-weight: 650; }
.tabs .tab.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: -1px;
  width: 22px; height: 3px; border-radius: 2px; transform: translateX(-50%);
  background: var(--brand);
}
.tabs .tab .badge { margin-left: 1px; }

/* ---------- Cells / lists ---------- */
.cell-group {
  background: var(--card); border-radius: var(--r-l);
  border: 1px solid var(--line-2); overflow: hidden;
  box-shadow: var(--shadow-card);
}
.cell {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 12px 16px;
  position: relative; width: 100%; text-align: left;
  transition: background var(--dur-1);
}
.cell + .cell::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0;
  height: 1px; background: var(--line-2);
}
.cell--inset + .cell::before { left: 64px; }
.cell:active { background: var(--card-2); }
.cell-ico {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--brand-100); color: var(--brand-600);
}
.cell-ico .icon { width: 19px; height: 19px; }
.cell-ico.is-orange { background: var(--warning-soft); color: var(--warning-deep); }
.cell-ico.is-green { background: var(--success-soft); color: var(--success-deep); }
.cell-ico.is-red { background: var(--danger-soft); color: var(--danger-deep); }
.cell-ico.is-purple { background: var(--purple-soft); color: var(--purple); }
.cell-ico.is-gray { background: var(--bg-2); color: var(--text-3); }
.cell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cell-title { font-size: 14.5px; font-weight: 550; letter-spacing: -.005em; }
.cell-desc { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.cell-val { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.cell-chevron { width: 16px; height: 16px; color: var(--text-4); margin-right: -3px; flex: none; }
.cell--danger .cell-title { color: var(--danger); }
.cell--danger .cell-ico { background: var(--danger-soft); color: var(--danger); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 550; color: var(--text-2);
  margin-bottom: 8px; gap: 8px;
}
.field-label .req { color: var(--danger); margin-left: 2px; }
.field-hint { font-size: 11.5px; color: var(--text-3); line-height: 1.5; margin-top: 6px; }
.field-error { font-size: 11.5px; color: var(--danger); margin-top: 6px; display: none; }
.field.has-error .field-error { display: block; }
.field.has-error .input, .field.has-error .fake-input { border-color: var(--danger); }

.input, .textarea, .fake-input {
  width: 100%; border: 1px solid var(--line);
  background: var(--card-2);
  border-radius: 11px;
  font-size: 14.5px; color: var(--text-1);
  transition: border-color var(--dur-1), background var(--dur-1), box-shadow var(--dur-2);
  outline: none;
}
.input { height: 46px; padding: 0 14px; }
.textarea { min-height: 96px; padding: 12px 14px; resize: none; line-height: 1.6; display: block; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:focus, .textarea:focus { border-color: var(--brand); background: var(--card); box-shadow: 0 0 0 3px var(--brand-100); }
.fake-input {
  height: 46px; padding: 0 12px 0 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-align: left;
}
.fake-input.is-placeholder { color: var(--text-4); }
.fake-input:active { border-color: var(--brand-300); }
.input-affix { position: relative; }
.input-affix .input { padding-right: 44px; }
.input-affix .affix {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center; color: var(--text-3);
}
.input-count { font-size: 11px; color: var(--text-4); text-align: right; margin-top: 5px; font-family: var(--font-num); }

/* checkbox / radio / switch */
.check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.check-box {
  width: 21px; height: 21px; border-radius: 7px; flex: none;
  border: 1.5px solid var(--line); background: var(--card);
  display: grid; place-items: center; color: #fff;
  transition: all var(--dur-2) var(--ease-out);
}
.check-box .icon { width: 13px; height: 13px; stroke-width: 2.6; opacity: 0; transform: scale(.5); transition: all var(--dur-2) var(--ease-spring); }
.check.is-checked .check-box { background: var(--brand); border-color: var(--brand); }
.check.is-checked .check-box .icon { opacity: 1; transform: scale(1); }
.check-box--round { border-radius: 50%; }
.radio-box {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--line); background: var(--card);
  display: grid; place-items: center;
  transition: all var(--dur-2);
}
.radio-box::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform var(--dur-2) var(--ease-spring); }
.radio.is-checked .radio-box { background: var(--brand); border-color: var(--brand); }
.radio.is-checked .radio-box::after { transform: scale(1); }

.switch {
  width: 48px; height: 28px; border-radius: 14px; flex: none;
  background: #d6dbe3; position: relative;
  transition: background var(--dur-2) var(--ease-out);
}
body.theme-dark .switch { background: #3a404c; }
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .22);
  transition: transform var(--dur-2) var(--ease-spring);
}
.switch.is-on { background: var(--brand); }
.switch.is-on::after { transform: translateX(20px); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 34px; padding: 0 13px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 13px; color: var(--text-2); font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all var(--dur-1);
}
.chip.is-active { border-color: var(--brand); color: var(--brand-600); background: var(--brand-100); font-weight: 600; }
.chip:active { transform: scale(.97); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 5.5px; top: 8px; bottom: 10px;
  width: 1.5px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 2px; }
.tl-dot {
  position: absolute; left: -22px; top: 3px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--brand);
}
.tl-item.is-done .tl-dot { background: var(--brand); border-color: var(--brand); box-shadow: inset 0 0 0 2.5px var(--card); }
.tl-item.is-warn .tl-dot { border-color: var(--warning); background: var(--warning); box-shadow: inset 0 0 0 2.5px var(--card); }
.tl-item.is-danger .tl-dot { border-color: var(--danger); background: var(--danger); box-shadow: inset 0 0 0 2.5px var(--card); }
.tl-item.is-idle .tl-dot { border-color: var(--line); background: var(--card); }
.tl-time { font-size: 11.5px; color: var(--text-3); font-family: var(--font-num); font-weight: 600; letter-spacing: .01em; }
.tl-title { font-size: 14px; font-weight: 600; margin-top: 2px; }
.tl-desc { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }

/* ---------- Notice ---------- */
.notice {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--warning-soft); color: var(--warning-deep);
  font-size: 12px; line-height: 1.55;
}
.notice .icon { width: 16px; height: 16px; margin-top: .5px; flex: none; }
.notice--info { background: var(--brand-100); color: var(--brand-600); }
.notice--danger { background: var(--danger-soft); color: var(--danger-deep); }
.notice-text { flex: 1; min-width: 0; }
.notice-act {
  flex: none; align-self: center;
  height: 26px; padding: 0 9px; margin-left: 2px;
  border-radius: 7px; font-size: 11px; font-weight: 650;
  color: inherit; background: rgba(255, 255, 255, .55);
  border: 1px solid currentColor;
  opacity: .9;
}
body.theme-dark .notice-act { background: rgba(255, 255, 255, .08); }
.notice-close {
  flex: none; align-self: flex-start;
  width: 24px; height: 24px; margin: -2px -4px 0 2px;
  border-radius: 50%; display: grid; place-items: center;
  color: inherit; opacity: .55;
}
.notice-close:active { opacity: 1; background: rgba(0, 0, 0, .06); }
.notice-close .icon { width: 12px; height: 12px; margin: 0; }

/* ---------- Progress ---------- */
.bar { height: 6px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--brand); transition: width .6s var(--ease-out); }
.bar-fill.is-green { background: var(--success); }
.bar-fill.is-orange { background: var(--warning); }
.bar-fill.is-red { background: var(--danger); }
.bar--thin { height: 4px; }

/* ---------- Empty state ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 20px; text-align: center;
}
.empty-ico {
  width: 76px; height: 76px; border-radius: 26px;
  display: grid; place-items: center; margin-bottom: 14px;
  background: radial-gradient(circle at 30% 20%, var(--brand-100), var(--bg-2));
  color: var(--brand-400);
}
.empty-ico .icon { width: 34px; height: 34px; stroke-width: 1.5; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-2); }
.empty-desc { font-size: 12px; color: var(--text-3); margin-top: 5px; max-width: 220px; line-height: 1.6; }

/* ---------- Stat tiles ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--r-m); padding: 12px 12px 11px;
  display: flex; flex-direction: column; gap: 3px;
  box-shadow: var(--shadow-1);
}
.stat-val { font-family: var(--font-num); font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.stat-val small { font-size: 11px; font-weight: 600; color: var(--text-3); margin-left: 2px; letter-spacing: 0; }
.stat-label { font-size: 11px; color: var(--text-3); font-weight: 500; }
.stat--flat { box-shadow: none; background: var(--card-2); }

/* ---------- Sheet / dialog / overlay ---------- */
.overlay-root {
  position: absolute; inset: 0; z-index: 300;
  pointer-events: none;
}
.overlay-root > * { pointer-events: auto; }
.mask {
  position: absolute; inset: 0; background: var(--mask);
  opacity: 0; transition: opacity var(--dur-2);
  backdrop-filter: blur(1px);
}
.mask.is-open { opacity: 1; }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  transform: translateY(102%);
  transition: transform var(--dur-3) var(--ease-out);
  max-height: 86%;
  display: flex; flex-direction: column;
  box-shadow: 0 -12px 40px -12px rgba(15, 23, 42, .28);
  z-index: 2;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sheet.is-open { transform: translateY(0); }
.sheet-grab { padding: 8px 0 2px; display: grid; place-items: center; flex: none; }
.sheet-grab::before { content: ""; width: 38px; height: 4px; border-radius: 2px; background: var(--line); }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px 6px; flex: none; gap: 12px;
}
.sheet-title { font-size: 16px; font-weight: 650; }
.sheet-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.sheet-close {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg-2); color: var(--text-3);
}
.sheet-close .icon { width: 15px; height: 15px; }
.sheet-body { padding: 10px 20px 22px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.sheet-body::-webkit-scrollbar { width: 0; }
.sheet-foot { padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-2); flex: none; display: flex; gap: 10px; }
.sheet--tall { height: 88%; }
.sheet--auto { max-height: 86%; }

.dialog {
  position: absolute; left: 50%; top: 50%;
  width: 300px; max-width: calc(100% - 48px);
  transform: translate(-50%, -50%) scale(.94);
  background: var(--card); border-radius: 18px;
  padding: 22px 20px 0;
  opacity: 0;
  transition: all var(--dur-2) var(--ease-out);
  box-shadow: var(--shadow-3);
  z-index: 3;
}
.dialog.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.dialog-title { font-size: 17px; font-weight: 650; text-align: center; }
.dialog-body { font-size: 13.5px; color: var(--text-2); text-align: center; line-height: 1.65; margin-top: 10px; }
.dialog-actions { display: flex; margin: 20px -20px 0; border-top: 1px solid var(--line-2); }
.dialog-actions button {
  flex: 1; height: 50px; font-size: 15px; font-weight: 600; color: var(--text-2);
}
.dialog-actions button + button { border-left: 1px solid var(--line-2); }
.dialog-actions .is-primary { color: var(--brand); }
.dialog-actions .is-danger { color: var(--danger); }
.dialog-input { margin-top: 14px; }

.action-sheet { position: absolute; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); transform: translateY(110%); transition: transform var(--dur-3) var(--ease-out); z-index: 2; }
.action-sheet.is-open { transform: translateY(0); }
.action-sheet-group { background: var(--card); border-radius: 16px; overflow: hidden; margin-bottom: 8px; }
.action-sheet-item { width: 100%; height: 54px; font-size: 16px; font-weight: 500; color: var(--text-1); }
.action-sheet-item + .action-sheet-item { border-top: 1px solid var(--line-2); }
.action-sheet-item.is-danger { color: var(--danger); }
.action-sheet-item:active { background: var(--card-2); }
.action-sheet-cancel { height: 54px; width: 100%; font-size: 16px; font-weight: 600; color: var(--text-2); background: var(--card); border-radius: 16px; }

/* ---------- Toast ---------- */
.toast-layer { position: absolute; top: 0; left: 0; right: 0; z-index: 400; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 54px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px;
  max-width: 300px; padding: 10px 14px;
  border-radius: 12px;
  background: rgba(31, 35, 41, .92); color: #fff;
  font-size: 13px; font-weight: 500; line-height: 1.45;
  box-shadow: 0 10px 28px -8px rgba(15, 23, 42, .4);
  backdrop-filter: blur(12px);
  animation: toastIn .3s var(--ease-out) both;
}
.toast .icon { width: 16px; height: 16px; flex: none; }
.toast.is-out { animation: toastOut .25s ease forwards; }
.toast--success .icon { color: #7ee787; }
.toast--error .icon { color: #ff9a95; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* ---------- Calendar (shared by records & date pickers) ---------- */
.cal { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 10px; }
.cal-month { font-size: 15px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; }
.cal-month em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--text-3); }
.cal-nav { display: flex; gap: 2px; }
.cal-nav button {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  color: var(--text-2); background: var(--bg-2);
}
.cal-nav button:active { background: var(--line); }
.cal-nav .icon { width: 16px; height: 16px; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.cal-week span { text-align: center; font-size: 10.5px; font-weight: 600; color: var(--text-4); height: 22px; line-height: 22px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 3px; }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1.06;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; border-radius: 11px;
  font-family: var(--font-num); font-size: 14px; font-weight: 550;
  color: var(--text-1); transition: background var(--dur-1), color var(--dur-1);
}
.cal-cell.is-out { color: var(--text-4); opacity: .5; }
.cal-cell.is-weekend { color: var(--text-3); }
.cal-cell.is-today { color: var(--brand-600); font-weight: 750; }
.cal-cell.is-today::before {
  content: ""; position: absolute; inset: 3px; border-radius: 10px;
  border: 1.2px solid var(--brand-300); pointer-events: none;
}
.cal-cell.is-selected { background: var(--brand); color: #fff; box-shadow: var(--brand-glow); }
.cal-cell.is-selected .cal-dot { background: #fff !important; opacity: .95; }
.cal-cell.is-selected.is-today::before { border-color: transparent; }
.cal-cell.is-disabled { color: var(--text-4); opacity: .35; pointer-events: none; }
.cal-dot { width: 4.5px; height: 4.5px; border-radius: 50%; background: var(--text-3); }
.cal-dots { display: flex; gap: 2.5px; height: 5px; align-items: center; }
.cal-range { background: var(--brand-100); border-radius: 0; color: var(--brand-600); }
.cal-range.is-range-start { border-radius: 10px 0 0 10px; background: linear-gradient(90deg, var(--brand) 0 50%, var(--brand-100) 50%); color: #fff; }
.cal-range.is-range-end { border-radius: 0 10px 10px 0; background: linear-gradient(90deg, var(--brand-100) 0 50%, var(--brand) 50%); color: #fff; }
.cal-range.is-range-start.is-range-end { border-radius: 10px; background: var(--brand); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; padding: 0 2px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-3); }
.cal-legend i { width: 6px; height: 6px; border-radius: 50%; }

/* ---------- Date range picker ---------- */
.cal-range-host { padding-bottom: 2px; }
.cal-range-sum {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  margin-top: 12px; padding: 10px 12px;
  border-radius: 11px;
  background: var(--brand-50); border: 1px solid var(--brand-100);
  font-size: 11.5px; color: var(--text-2);
  min-height: 42px;
}
body.theme-dark .cal-range-sum { background: var(--brand-100); border-color: transparent; }
.cal-range-sum b { font-size: 12px; font-weight: 650; color: var(--text-1); }
.cal-range-sum i { font-style: normal; color: var(--text-4); }
.cal-range-sum .is-muted { color: var(--text-3); }
.cal-range-days {
  margin-left: auto;
  font-family: var(--font-num); font-size: 10.5px; font-weight: 700;
  color: var(--brand-600); background: var(--brand-100);
  padding: 2px 7px; border-radius: 6px;
}
.cal-range-hint { font-size: 10.5px; color: var(--text-4); line-height: 1.55; margin-top: 8px; }

/* ---------- Upload ---------- */
.uploader { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.upload-item {
  aspect-ratio: 1; border-radius: 10px; position: relative;
  background: var(--card-2); border: 1px dashed var(--line);
  display: grid; place-items: center; color: var(--text-3); gap: 2px;
  font-size: 10px; overflow: hidden;
}
.upload-item .icon { width: 20px; height: 20px; }
.upload-item.is-image { border-style: solid; border-color: transparent; }
.upload-item.is-image img { width: 100%; height: 100%; object-fit: cover; }
.upload-item .rm {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff;
  display: grid; place-items: center;
}
.upload-item .rm .icon { width: 11px; height: 11px; }

/* ---------- Misc ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--card-2) 37%, var(--bg-2) 63%);
  background-size: 440px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}
.ripple-line { height: 1px; background: var(--line-2); }
.pull-tip { text-align: center; font-size: 11px; color: var(--text-4); padding: 8px 0 4px; }
.scroll-x { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.scroll-x::-webkit-scrollbar { display: none; }
.link { color: var(--brand); font-weight: 550; }
.link:active { opacity: .7; }

/* ---------- Time picker ---------- */
.time-picker {
  display: flex; align-items: stretch; justify-content: center; gap: 6px;
  height: 216px; margin-top: 4px;
}
.time-col {
  flex: 1; max-width: 120px;
  overflow-y: auto; scrollbar-width: none;
  border-radius: 12px; background: var(--card-2);
  padding: 6px;
  display: flex; flex-direction: column; gap: 3px;
  scroll-behavior: smooth;
}
.time-col::-webkit-scrollbar { width: 0; }
.time-sep { display: grid; place-items: center; font-family: var(--font-num); font-size: 20px; font-weight: 700; color: var(--text-3); }
.time-cell {
  flex: none; height: 38px; border-radius: 9px;
  font-family: var(--font-num); font-size: 15px; font-weight: 600;
  color: var(--text-2); transition: all var(--dur-1);
}
.time-cell.is-active { background: var(--brand); color: #fff; box-shadow: 0 4px 10px -4px rgba(22, 119, 255, .7); }
.time-cell:active { transform: scale(.97); }

/* ---------- Flip / misc ---------- */
.big-punch.is-done .big-punch-inner { color: var(--success-deep); }
.big-punch.is-done::before, .big-punch.is-done::after { display: none; }
.punch-page.is-done { background: linear-gradient(175deg, #0b3d2a 0%, #116b47 45%, #00b42a 110%); }
