.app-ready .staff-shell {
  padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
}

.app-bottom-nav {
  width: min(520px, calc(100% - 24px));
  min-height: 64px;
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(16, 42, 48, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 42px rgba(16, 42, 48, 0.2);
  backdrop-filter: blur(16px);
}

.app-nav-item {
  min-height: 50px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 4px 10px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}

.app-nav-item svg {
  width: 19px;
  height: 19px;
}

.app-nav-item.active {
  color: var(--teal);
  background: #eaf5f2;
}

.profile-panel {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.profile-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  color: var(--teal);
  background: #eaf5f2;
  font-size: 23px;
}

.profile-card-copy {
  min-width: 0;
}

.profile-card-copy h1,
.profile-card-copy h2.panel-heading {
  margin: 2px 0 5px;
  color: var(--navy);
  font-size: 25px;
  font-weight: 650;
}

.profile-card-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.profile-metrics > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 17px 18px;
  background: var(--surface);
}

.profile-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.profile-metrics strong {
  color: var(--navy);
  font-size: 24px;
  font-weight: 650;
}

.profile-inventory-section .employee-inventory-list {
  padding: 12px;
}

.profile-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.profile-section-head h2 {
  margin: 0;
  color: var(--navy);
  font-size: 15px;
}

.profile-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.profile-info-list {
  margin: 0;
  padding: 0 18px;
}

.profile-info-list > div {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.profile-info-list > div:last-child {
  border-bottom: 0;
}

.profile-info-list dt {
  color: var(--muted);
  font-size: 12px;
}

.profile-info-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  text-align: right;
}

.profile-logout {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #e8c8c4;
  border-radius: 10px;
  color: var(--red);
  background: #fffafa;
  font-size: 12px;
  font-weight: 600;
}

.profile-logout svg {
  width: 16px;
  height: 16px;
}

.profile-version {
  margin: 2px 0 0;
  color: #8a9a9c;
  font-size: 12px;
  text-align: center;
}

.inventory-panel {
  display: grid;
  gap: 18px;
}

.inventory-profile {
  margin-bottom: 0;
}

.inventory-avatar {
  color: var(--teal);
  background: #eaf5f2;
}

.inventory-avatar svg {
  width: 24px;
  height: 24px;
}

.employee-inventory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  background: var(--surface-soft);
}

.employee-inventory-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.inventory-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.inventory-device-icon,
.request-type-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--teal);
  background: #eaf5f2;
}

.inventory-device-icon svg,
.request-type-icon svg {
  width: 17px;
  height: 17px;
}

.inventory-card-copy {
  min-width: 0;
  flex: 1;
}

.inventory-card-copy strong,
.inventory-card-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-card-copy strong {
  color: var(--navy);
  font-size: 13px;
}

.inventory-card-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.inventory-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.inventory-status svg {
  width: 12px;
  height: 12px;
}

.inventory-status-unused {
  color: var(--green);
  background: #e9f5ef;
}

.inventory-status-pending,
.inventory-status-returning,
.inventory-status-repair {
  color: var(--amber);
  background: #fbf2e4;
}

.inventory-status-assigned {
  color: var(--blue);
  background: #edf3fa;
}

.inventory-status-retired {
  color: var(--muted);
  background: #eef1ef;
}

.inventory-card-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.inventory-card-info > div {
  min-width: 0;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
}

.inventory-card-info > div:last-child {
  border-right: 0;
}

.inventory-card-info dt {
  color: var(--muted);
  font-size: 12px;
}

.inventory-card-info dd {
  overflow: hidden;
  margin: 5px 0 0;
  color: #34494d;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-card-note {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.inventory-return-history {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 9px 12px;
  color: #8b4c28;
  border-bottom: 1px solid var(--line);
  background: #fff8f1;
  font-size: 12px;
  line-height: 1.55;
}

.inventory-return-history svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 2px;
}

.inventory-card-actions {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 12px;
  background: #fbfcfc;
}

.inventory-card-muted {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-card-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.inventory-card-button svg {
  width: 14px;
  height: 14px;
}

.inventory-card-button.return {
  color: var(--blue);
  border-color: #cfddea;
}

.inventory-empty {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.inventory-empty svg {
  width: 28px;
  height: 28px;
  color: #9aadaa;
}

.inventory-empty strong {
  color: var(--navy);
  font-size: 13px;
}

.inventory-empty span {
  font-size: 12px;
}

.inventory-empty.small {
  min-height: 110px;
}

.request-history-section {
  margin-top: 2px;
}

.employee-request-list {
  display: grid;
  background: var(--surface);
}

.employee-request-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.employee-request-item:last-child {
  border-bottom: 0;
}

.request-type-icon.returning {
  color: var(--blue);
  background: #edf3fa;
}

.employee-request-copy {
  min-width: 0;
  flex: 1;
}

.employee-request-copy strong,
.employee-request-copy span,
.employee-request-copy small {
  display: block;
}

.employee-request-copy strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-request-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.employee-request-copy small {
  margin-top: 5px;
  color: #6d5a35;
  font-size: 12px;
  line-height: 1.5;
}

.request-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.request-pending {
  color: var(--amber);
  background: #fbf2e4;
}

.request-approved {
  color: var(--green);
  background: #e9f5ef;
}

.request-rejected {
  color: var(--red);
  background: #fbeeed;
}

.inventory-request-dialog {
  width: min(520px, calc(100vw - 28px));
}

.inventory-request-device {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.inventory-request-device > div {
  min-width: 0;
}

.inventory-request-device strong,
.inventory-request-device span {
  display: block;
}

.inventory-request-device strong {
  color: var(--navy);
  font-size: 14px;
}

.inventory-request-device span {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-request-tip {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 7px;
  color: #556a6d;
  background: #eef5f3;
  font-size: 12px;
  line-height: 1.6;
}

.inventory-request-tip svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--teal);
}
@media (max-width: 680px) {
  .portal-main {
    width: calc(100% - 24px);
  }

  .staff-app {
    padding-top: 14px;
  }

  .employee-profile {
    border-radius: 12px;
    box-shadow: 0 7px 22px rgba(16, 42, 48, 0.055);
  }

  .ledger-section,
  .profile-card,
  .profile-metrics,
  .profile-section {
    border-radius: 10px;
  }

  .profile-card {
    padding: 18px;
  }

  .profile-avatar {
    width: 54px;
    height: 54px;
    font-size: 20px;
  }

  .profile-card-copy h1,
  .profile-card-copy h2.panel-heading {
    font-size: 22px;
  }

  .profile-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-metrics > div {
    padding: 14px 12px;
  }

  .profile-metrics strong {
    font-size: 21px;
  }

  .inventory-profile {
    display: block;
  }

  .employee-inventory-list {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .inventory-card-info {
    grid-template-columns: 1fr;
  }

  .inventory-card-info > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .inventory-card-info dd {
    margin-top: 0;
    text-align: right;
  }

  .employee-request-item {
    align-items: flex-start;
    padding: 12px;
  }

  .app-bottom-nav {
    width: calc(100% - 18px);
    bottom: calc(7px + env(safe-area-inset-bottom, 0px));
    border-radius: 12px;
  }
}

@media (max-width: 380px) {
  .employee-profile-main .eyebrow {
    display: none;
  }

  .employee-profile-main h1,
  .employee-profile-main h2.panel-heading {
    font-size: 18px;
  }

  .employee-profile-actions .primary-button {
    padding: 0 10px;
    font-size: 12px;
  }
}

/* ── 键盘焦点可见性 ─────────────────────────────────────────────
   上方各控件用 outline:0 关掉默认环、改用 box-shadow 表达鼠标聚焦。
   这里只补 :focus-visible：特异性与元素规则相同、位置更靠后因此生效，
   既让键盘/助残用户看到明确焦点，又不改变鼠标点击时的既有观感。 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--teal, #0f766e);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 深色页头/侧栏上用浅色环，保证对比度 */
.admin-sidebar :focus-visible,
.admin-topbar :focus-visible,
.portal-header :focus-visible,
.topbar :focus-visible,
.mobile-app-bar :focus-visible {
  outline-color: #7fe3d4;
}

/* ── 动效降级与高对比度兜底 ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Windows 高对比度 / forced-colors 会剥离 box-shadow 并覆盖自定义颜色，
   而本项目的焦点环与状态标签大量依赖二者，这里给出兜底。 */
@media (forced-colors: active) {
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  [tabindex]:focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }

  /* 状态标签不能只靠底色区分，强制补边框 */
  .status-pill,
  .pill,
  .review-approved,
  .review-pending,
  .status-normal,
  .status-abnormal,
  .status-blocked,
  .status-pending,
  .account-active,
  .account-inactive,
  .audit-type-update,
  .audit-type-create,
  .audit-type-review,
  .audit-type-delete,
  .audit-type-auth,
  .audit-type-system {
    border: 1px solid CanvasText;
    forced-color-adjust: none;
  }

  .live-dot {
    forced-color-adjust: none;
  }

  .data-table thead th {
    background: Canvas;
    color: CanvasText;
  }
}
