@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@400;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --ink: #1b1a17;
  --muted: #5b5b5b;
  --accent: #f6c453;
  --accent-2: #50b2a1;
  --accent-3: #f1957e;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --border: rgba(24, 24, 24, 0.1);
  --shadow: 0 20px 50px rgba(34, 30, 22, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f2efe8;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

.ambient {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(246, 196, 83, 0.35), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(80, 178, 161, 0.25), transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(241, 149, 126, 0.25), transparent 45%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(238, 231, 219, 0.9));
  z-index: -1;
}

.app {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(242, 239, 232, 0.86);
  backdrop-filter: blur(18px);
}

.auth-overlay[hidden] {
  display: none;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

#authOverlay {
  background: rgba(7, 8, 10, 0.78);
  backdrop-filter: blur(22px);
}

#authOverlay .auth-card {
  color: #fffaf0;
  background:
    linear-gradient(145deg, rgba(18, 19, 22, 0.98), rgba(39, 39, 42, 0.96) 54%, rgba(16, 18, 20, 0.98)),
    #18191d;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

#authOverlay .auth-card h1,
#authOverlay .auth-card .muted,
#authOverlay .auth-card .auth-contact,
#authOverlay .auth-card .field span,
#authOverlay .auth-card .remember-line {
  color: rgba(255, 250, 240, 0.84);
}

#authOverlay .auth-card input {
  color: #fffaf0;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

#authOverlay .auth-card input::placeholder {
  color: rgba(255, 250, 240, 0.36);
}

#authOverlay .auth-card .button.primary {
  color: #201b0a;
  box-shadow: 0 16px 34px rgba(255, 153, 116, 0.24);
}

.auth-card h1 {
  margin: 0;
  text-align: center;
  font-size: 1.8rem;
}

.auth-card .muted,
.auth-contact {
  margin: 0;
  text-align: center;
}

.auth-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 14px;
  color: #2c2108;
  font-weight: 800;
  background: linear-gradient(135deg, #b9f3e6, #f6e66f 52%, #ff9974);
}

.remember-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.remember-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.auth-contact {
  color: var(--muted);
  font-size: 0.82rem;
}

.web-account-bar,
.web-account-admin {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(34, 30, 22, 0.08);
}

.web-account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.web-account-bar[hidden],
.web-account-admin[hidden] {
  display: none;
}

.web-account-bar h2,
.web-account-admin h2 {
  margin: 0 0 4px;
}

.web-account-actions,
.account-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.account-admin-head > div:first-child {
  min-width: min(100%, 360px);
}

.account-admin-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.tenant-select,
.account-editor-form input,
.account-editor-form select,
.account-search input,
.account-modal input,
.account-modal select {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  font: inherit;
}

.account-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.account-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.account-search {
  display: grid;
  gap: 5px;
  min-width: min(100%, 330px);
  color: var(--muted);
  font-size: 0.82rem;
}

.account-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.68)),
    var(--surface);
  box-shadow: 0 10px 24px rgba(34, 30, 22, 0.08);
}

.account-card-head,
.account-card-foot,
.account-card-actions,
.account-card-title,
.account-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-card-head,
.account-card-foot {
  justify-content: space-between;
}

.account-card-head {
  align-items: flex-start;
}

.account-card-title {
  min-width: 0;
  flex-wrap: wrap;
}

.account-card-title strong {
  max-width: 180px;
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.account-card-foot {
  align-items: flex-end;
  padding-top: 10px;
  border-top: 1px solid rgba(24, 24, 24, 0.08);
}

.account-card-note {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.account-card-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-role-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  color: #6b4310;
  background: rgba(246, 196, 83, 0.24);
  font-size: 0.75rem;
  font-weight: 700;
}

.account-status-tag {
  display: flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.account-status-tag.is-active {
  color: #1c5d52;
  background: rgba(80, 178, 161, 0.16);
}

.account-status-tag.is-disabled {
  color: #8a4331;
  background: rgba(241, 149, 126, 0.18);
}

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

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

.account-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
}

.account-modal[hidden] {
  display: none;
}

.account-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 26, 23, 0.42);
  backdrop-filter: blur(5px);
}

.account-modal-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.account-modal-head,
.account-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-modal-head h2,
.account-modal-head .eyebrow,
.account-modal-card .muted {
  margin: 0;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.account-modal-card .field input,
.account-modal-card .field select {
  width: 100%;
}

.account-modal-card select:disabled {
  color: rgba(27, 26, 23, 0.58);
  background: rgba(255, 255, 255, 0.42);
}

@keyframes accountPanelFlow {
  0% {
    transform: translate3d(-18%, -10%, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(10%, 5%, 0) rotate(2deg);
  }
  100% {
    transform: translate3d(-18%, -10%, 0) rotate(0deg);
  }
}

@keyframes accountSurfaceIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes accountRise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes accountModalIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.web-account-admin {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  color: #fffaf0;
  background:
    linear-gradient(135deg, rgba(19, 20, 24, 0.98), rgba(43, 42, 43, 0.96) 46%, rgba(16, 38, 34, 0.98)),
    #18191d;
  box-shadow: 0 28px 70px rgba(18, 20, 18, 0.28);
}

.web-account-admin::before {
  content: "";
  position: absolute;
  inset: -35% -18%;
  z-index: -1;
  background:
    linear-gradient(115deg, transparent 10%, rgba(185, 243, 230, 0.12) 28%, transparent 43%),
    linear-gradient(62deg, transparent 32%, rgba(246, 196, 83, 0.15) 48%, transparent 66%),
    linear-gradient(145deg, transparent 40%, rgba(241, 149, 126, 0.12) 60%, transparent 78%);
  opacity: 0.9;
  animation: accountPanelFlow 10s ease-in-out infinite;
  pointer-events: none;
}

.web-account-admin .eyebrow {
  color: rgba(255, 250, 240, 0.58);
}

.web-account-admin h2 {
  margin: 2px 0 8px;
  color: #fffaf0;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.08;
}

.web-account-admin .muted {
  color: rgba(255, 250, 240, 0.66);
}

.account-admin-head {
  position: relative;
  z-index: 1;
  align-items: flex-start;
  margin-bottom: 18px;
}

.account-admin-head-actions .button {
  border-color: rgba(255, 255, 255, 0.18);
  color: #fffaf0;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.account-admin-head-actions .button.primary {
  color: #231d0a;
  border: none;
  background: linear-gradient(135deg, #b9f3e6, #f6e66f 52%, #ff9974);
  box-shadow: 0 14px 28px rgba(255, 159, 111, 0.28);
}

.account-admin-head-actions .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.26);
}

.account-admin-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 10px 0 18px;
}

.account-stat-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: accountRise 0.5s ease both;
  animation-delay: calc(var(--account-index, 0) * 55ms);
}

.account-stat-card span,
.account-stat-card small {
  overflow: hidden;
  color: rgba(255, 250, 240, 0.62);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-stat-card strong {
  color: #fffaf0;
  font-size: 1.55rem;
  line-height: 1;
}

.account-stat-card.mint {
  background: linear-gradient(135deg, rgba(185, 243, 230, 0.18), rgba(255, 255, 255, 0.06));
}

.account-stat-card.gold {
  background: linear-gradient(135deg, rgba(246, 230, 111, 0.18), rgba(255, 255, 255, 0.06));
}

.account-stat-card.coral {
  background: linear-gradient(135deg, rgba(255, 153, 116, 0.18), rgba(255, 255, 255, 0.06));
}

.account-stat-card.slate {
  background: linear-gradient(135deg, rgba(154, 170, 190, 0.18), rgba(255, 255, 255, 0.06));
}

.account-admin-toolbar {
  position: relative;
  z-index: 1;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
}

.account-search {
  grid-template-columns: auto minmax(180px, 420px);
  align-items: center;
  gap: 10px;
  width: min(100%, 540px);
  color: rgba(255, 250, 240, 0.7);
}

.account-search input,
.account-modal input,
.account-modal select {
  border-color: rgba(255, 255, 255, 0.12);
  color: #fffaf0;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.account-search input::placeholder,
.account-modal input::placeholder {
  color: rgba(255, 250, 240, 0.42);
}

.account-search input:focus,
.account-modal input:focus,
.account-modal select:focus {
  border-color: rgba(185, 243, 230, 0.72);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(185, 243, 230, 0.12);
}

.web-account-admin #webAccountCount {
  color: rgba(255, 250, 240, 0.74);
}

.web-account-admin .form-message {
  position: relative;
  z-index: 1;
}

.account-admin-list {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.account-card {
  position: relative;
  overflow: hidden;
  gap: 16px;
  padding: 18px;
  border-color: rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  color: #fffaf0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: accountRise 0.52s cubic-bezier(0.2, 0.9, 0.2, 1) both;
  animation-delay: calc(var(--account-index, 0) * 65ms);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.account-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 3px solid rgba(185, 243, 230, 0.82);
  opacity: 0.9;
  pointer-events: none;
}

.account-card::after {
  content: "";
  position: absolute;
  inset: -60% auto auto -40%;
  width: 64%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: rotate(18deg) translateX(-120%);
  transition: transform 0.55s ease;
  pointer-events: none;
}

.account-card[data-role="agent"]::before {
  border-top-color: rgba(255, 153, 116, 0.86);
}

.account-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 28px 54px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.account-card:hover::after {
  transform: rotate(18deg) translateX(285%);
}

.account-card-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.account-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #201b0a;
  font-weight: 900;
  background: linear-gradient(135deg, #b9f3e6, #f6e66f 52%, #ff9974);
  box-shadow: 0 12px 24px rgba(255, 153, 116, 0.26);
}

.account-card[data-role="agent"] .account-avatar {
  color: #1b1510;
  background: linear-gradient(135deg, #ffd98b, #ff9974);
}

.account-identity {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-identity span {
  color: rgba(255, 250, 240, 0.58);
  font-size: 0.76rem;
}

.account-identity strong {
  overflow: hidden;
  color: #fffaf0;
  font-size: 1.22rem;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-status-tag {
  min-width: 46px;
  justify-content: center;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
}

.account-status-tag.is-active {
  color: #c9fff3;
  border-color: rgba(185, 243, 230, 0.28);
  background: rgba(80, 178, 161, 0.18);
}

.account-status-tag.is-disabled {
  color: #ffd1c3;
  border-color: rgba(255, 153, 116, 0.28);
  background: rgba(241, 149, 126, 0.18);
}

.account-route {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(36px, 1fr) minmax(0, max-content);
  align-items: center;
  gap: 10px;
  color: rgba(255, 250, 240, 0.72);
  font-size: 0.86rem;
}

.account-route span {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-route i {
  height: 1px;
  min-width: 34px;
  background: linear-gradient(90deg, rgba(185, 243, 230, 0.1), rgba(185, 243, 230, 0.78), rgba(255, 153, 116, 0.65));
}

.account-route i::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  margin-left: auto;
  margin-top: -2.5px;
  border-radius: 50%;
  background: #ff9974;
  box-shadow: 0 0 14px rgba(255, 153, 116, 0.76);
}

.account-expiry {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.16);
}

.account-expiry > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-expiry span,
.account-expiry small,
.account-card-note {
  color: rgba(255, 250, 240, 0.62);
}

.account-expiry strong {
  color: #fffaf0;
}

.account-expiry b {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.account-expiry em {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--expiry-progress, 40%);
  border-radius: inherit;
  background: linear-gradient(90deg, #b9f3e6, #f6e66f);
}

.account-expiry.caution em {
  background: linear-gradient(90deg, #f6e66f, #ffbf6f);
}

.account-expiry.danger em {
  background: linear-gradient(90deg, #ff9974, #ff6f61);
}

.account-card-foot {
  padding-top: 0;
  border-top: none;
}

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

.account-card-actions .button {
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 250, 240, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

.account-card-actions .button:hover {
  color: #201b0a;
  background: linear-gradient(135deg, #b9f3e6, #f6e66f 52%, #ff9974);
}

.account-card-actions .account-delete:hover {
  color: #fffaf0;
  background: rgba(241, 149, 126, 0.26);
}

.account-modal-backdrop {
  background: rgba(9, 10, 12, 0.62);
  backdrop-filter: blur(12px);
}

.account-modal-card {
  width: min(560px, 100%);
  padding: 24px;
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  color: #fffaf0;
  background:
    linear-gradient(135deg, rgba(27, 28, 32, 0.96), rgba(35, 38, 38, 0.96)),
    #16171a;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.42);
  animation: accountModalIn 0.24s ease both;
}

.account-modal-head h2 {
  color: #fffaf0;
}

.account-modal-card .muted,
.account-modal-card .field span {
  color: rgba(255, 250, 240, 0.66);
}

.account-modal-card select:disabled {
  color: rgba(255, 250, 240, 0.46);
  background: rgba(255, 255, 255, 0.05);
}

.account-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.account-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.account-select-button {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  color: #fffaf0;
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.account-select-button:hover,
.account-select.is-open .account-select-button {
  border-color: rgba(185, 243, 230, 0.72);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(185, 243, 230, 0.1);
}

.account-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-select-arrow {
  width: 9px;
  height: 9px;
  border-right: 2px solid rgba(255, 250, 240, 0.72);
  border-bottom: 2px solid rgba(255, 250, 240, 0.72);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}

.account-select.is-open .account-select-arrow {
  transform: rotate(225deg) translate(-2px, -1px);
}

.account-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(185, 243, 230, 0.26);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(35, 38, 40, 0.98), rgba(20, 22, 25, 0.98)),
    #17191c;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.34);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.account-select.is-open .account-select-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.account-select-option {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: rgba(255, 250, 240, 0.82);
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.account-select-option:hover {
  color: #fffaf0;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.account-select-option.is-selected {
  color: #201b0a;
  background: linear-gradient(135deg, #b9f3e6, #f6e66f 52%, #ff9974);
  box-shadow: 0 10px 20px rgba(255, 153, 116, 0.18);
}

.account-select-option.is-selected::after {
  content: "";
  width: 7px;
  height: 12px;
  border-right: 2px solid #201b0a;
  border-bottom: 2px solid #201b0a;
  transform: rotate(45deg);
}

.account-select-option:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.account-select.is-disabled .account-select-button {
  cursor: not-allowed;
  color: rgba(255, 250, 240, 0.44);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
}

select,
.tenant-select,
.export-date-range,
.calendar-filter-select,
.account-editor-form select,
.account-modal select,
.field select,
.form select,
.panel select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.account-editor-form select,
.account-modal select,
.field select,
.form select,
.panel select,
.tenant-select,
.export-date-range,
.calendar-filter-select {
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 250, 240, 0.82) 50%),
    linear-gradient(135deg, rgba(255, 250, 240, 0.82) 50%, transparent 50%),
    linear-gradient(to right, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1));
  background-position:
    calc(100% - 20px) 55%,
    calc(100% - 14px) 55%,
    calc(100% - 34px) 50%;
  background-size: 6px 6px, 6px 6px, 1px 60%;
  background-repeat: no-repeat;
}

.modal-close {
  border-color: rgba(255, 255, 255, 0.16);
  color: #fffaf0;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.18s ease, background 0.18s ease;
}

.modal-close:hover {
  transform: rotate(90deg);
  background: rgba(255, 255, 255, 0.16);
}

.account-modal-actions .button.primary {
  color: #201b0a;
  background: linear-gradient(135deg, #b9f3e6, #f6e66f 52%, #ff9974);
}

@media (max-width: 760px) {
  .web-account-bar,
  .account-admin-head {
    align-items: stretch;
    flex-direction: column;
  }

  .web-account-actions,
  .account-admin-head-actions,
  .account-admin-list,
  .account-editor-grid {
    grid-template-columns: 1fr;
  }

  .web-account-actions,
  .account-admin-head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account-admin-toolbar,
  .account-card-head,
  .account-card-foot,
  .account-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account-card-actions {
    justify-content: stretch;
  }

  .account-card-actions .button,
  .account-admin-head-actions .button {
    flex: 1 1 0;
  }

  .web-account-admin {
    padding: 18px;
    border-radius: 20px;
  }

  .account-admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-search {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .account-card-top {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .account-status-tag {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .account-route {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-route i {
    display: none;
  }

  .account-modal {
    padding: 14px;
  }
}

/* ── 顶部 Tab 导航 ── */
.main-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 24px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(34, 30, 22, 0.06);
}

.mobile-bottom-nav {
  display: none;
}

.main-tab {
  flex: 1 1 auto;
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.main-tab:hover {
  color: var(--ink);
  background: rgba(27, 26, 23, 0.04);
}

.main-tab.active {
  background: var(--accent);
  color: #3d2c06;
  box-shadow: 0 4px 12px rgba(246, 196, 83, 0.3);
}

.tab-panel[hidden] {
  display: none;
}

.taskboard,
.order-workbench {
  display: grid;
  gap: 18px;
}

.taskboard-header,
.order-workbench-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 4px;
}

.taskboard-header h1,
.order-workbench-header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.taskboard-actions,
.order-status-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.taskboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.task-metric,
.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.task-metric {
  padding: 14px;
}

.task-metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.task-metric-value {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 700;
}

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

.task-card {
  min-height: 260px;
  overflow: hidden;
}

.task-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.task-card-header h2 {
  margin: 0;
  font-size: 1rem;
}

.task-card-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.task-card-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.task-count {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(27, 26, 23, 0.08);
  text-align: center;
  font-weight: 700;
}

.task-list {
  display: grid;
  gap: 0;
}

.task-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(27, 26, 23, 0.06);
}

.task-item:last-child {
  border-bottom: none;
}

.task-item-title {
  font-weight: 700;
}

.task-item-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.task-date-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(80, 178, 161, 0.12);
  color: #1c5d52;
  font-size: 0.78rem;
  font-weight: 700;
}

.task-date-badge.overdue {
  background: rgba(214, 84, 57, 0.12);
  color: #8b2f20;
}

.task-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-empty {
  padding: 18px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.order-status-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.order-status-tab.active {
  border-color: rgba(27, 26, 23, 0.3);
  background: var(--ink);
  color: #fff;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 32px;
}

.hero-text {
  flex: 0 0 min(360px, 38%);
}

.hero-text h1 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 2.6rem;
  margin: 8px 0 6px;
  letter-spacing: 0.5px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.hero-meta {
  display: grid;
  gap: 12px;
  grid-template-columns:
    minmax(300px, 1.1fr)
    minmax(260px, 0.9fr)
    minmax(240px, 0.8fr);
  align-items: start;
  flex: 1 1 auto;
  width: min(100%, 780px);
}

.legend,
.rule-box,
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
  container-type: inline-size;
}

.summary-title {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: 10px;
}

.summary-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-width: 0;
}

.summary-group {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(60, 45, 20, 0.08);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.5)),
    rgba(255, 255, 255, 0.48);
}

.summary-subtitle {
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(80, 178, 161, 0.14);
  color: #28584f;
  font-size: 0.78rem;
  font-weight: 700;
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  min-width: 0;
}

button.summary-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.summary-action-row {
  margin: 0;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.summary-action-row:hover,
.summary-action-row:focus-visible {
  background: rgba(246, 196, 83, 0.16);
  outline: none;
}

.summary-action-row:active {
  transform: translateY(1px);
}

.summary-label {
  color: var(--muted);
  font-size: 0.9rem;
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
}

.summary-value {
  font-weight: 700;
  font-size: clamp(1rem, 1.7vw, 1.1rem);
  color: #3d2c06;
  flex: 0 0 auto;
  white-space: nowrap;
}

@container (max-width: 360px) {
  .summary-split {
    grid-template-columns: 1fr;
  }
}

.data-card {
  display: grid;
  gap: 10px;
}

.data-card-copy,
.data-card-tip {
  margin: 0;
}

.data-card-tip {
  font-size: 0.8rem;
}

.compact-actions {
  gap: 8px;
}

.export-date-range {
  min-height: 34px;
  border-radius: 10px;
  padding: 4px 28px 4px 8px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #3b3322 50%),
    linear-gradient(135deg, #3b3322 50%, transparent 50%),
    linear-gradient(to right, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.08));
  background-position:
    calc(100% - 12px) 55%,
    calc(100% - 8px) 55%,
    calc(100% - 20px) 50%;
  background-size: 4px 4px, 4px 4px, 1px 40%;
  background-repeat: no-repeat;
  cursor: pointer;
}

.legend-title,
.rule-title {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.legend-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.device-panel,
.rental-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.device-panel .panel-header,
.rental-panel .panel-header {
  margin-bottom: 0;
}

.panel-body {
  min-height: 0;
  display: grid;
  gap: 16px;
  align-content: start;
}

.device-count-stats {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.device-count-stats .count-strong {
  font-weight: 700;
  color: var(--ink);
}

.device-count-stats .count-owned {
  color: #28584f;
}

.device-count-stats .count-partner {
  color: #5a3678;
}

.device-panel-close,
.mobile-device-toolbar,
.drawer-backdrop {
  display: none;
}

.mobile-device-trigger {
  width: 100%;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  text-align: left;
}

.mobile-device-trigger-label {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.mobile-device-summary {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.mobile-device-trigger-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 22px 24px;
  box-shadow: var(--shadow);
  animation: floatIn 0.6s ease both;
}

.panel.is-jump-target {
  border-color: rgba(80, 178, 161, 0.52);
  box-shadow: var(--shadow), 0 0 0 4px rgba(80, 178, 161, 0.16);
}

.availability-query.is-jump-target {
  border-color: rgba(80, 178, 161, 0.52);
  box-shadow: var(--shadow), 0 0 0 4px rgba(80, 178, 161, 0.16);
}

.calendar-panel {
  grid-column: span 2;
}

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

.panel-header h2 {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.5rem;
}

.panel-header p {
  margin: 4px 0 0;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.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;
}

.form {
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.compact-form {
  gap: 14px;
}

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

label {
  font-size: 0.9rem;
  color: var(--muted);
}

input,
select {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 1rem;
  min-height: 46px;
  background: var(--surface-strong);
  color: var(--ink);
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, #3b3322 50%),
    linear-gradient(135deg, #3b3322 50%, transparent 50%),
    linear-gradient(to right, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.08));
  background-position:
    calc(100% - 20px) 55%,
    calc(100% - 14px) 55%,
    calc(100% - 34px) 50%;
  background-size: 6px 6px, 6px 6px, 1px 60%;
  background-repeat: no-repeat;
}

select:disabled {
  background-image: none;
}

select::-ms-expand {
  display: none;
}

input:focus,
select:focus {
  outline: 2px solid rgba(80, 178, 161, 0.4);
  border-color: rgba(80, 178, 161, 0.6);
}

.slot-toggle {
  display: flex;
  gap: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
}

.radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--ink);
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 42px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}

.button.small {
  padding: 6px 12px;
  font-size: 0.75rem;
}

#deviceCancelBtn {
  display: none;
}

.button.primary {
  background: var(--accent);
  color: #3d2c06;
  box-shadow: 0 10px 20px rgba(246, 196, 83, 0.3);
}

.button.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}

.button.danger {
  border-color: rgba(179, 65, 65, 0.4);
  color: #8b1f1f;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 18px rgba(28, 22, 12, 0.16);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.form-message {
  min-height: 20px;
  font-size: 0.9rem;
}

.form-message.error {
  color: #b43838;
}

.form-message.success {
  color: #2c7a5b;
}

/* ── 租赁表单步骤指示器（移动端） ── */
.rental-step-indicator {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-bottom: 16px;
}

.rental-step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-strong);
  border: 2px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.25s ease;
}

.rental-step-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #3d2c06;
}

.rental-step-dot.done {
  background: rgba(80, 178, 161, 0.18);
  border-color: rgba(80, 178, 161, 0.5);
  color: #1c5d52;
}

.rental-step-line {
  width: 40px;
  height: 2px;
  background: var(--border);
}

.rental-step-line.done {
  background: rgba(80, 178, 161, 0.4);
}

.rental-step[hidden] {
  display: none;
}

.rental-step-actions {
  justify-content: space-between;
}

.rental-date-shortcuts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.date-shortcut-btn {
  font-size: 0.78rem;
  padding: 4px 10px;
  min-height: auto;
}

/* 桌面端：步骤1和2合并为单页表单 */
@media (min-width: 681px) {
  .rental-step-indicator {
    display: none !important;
  }
  .rental-step[data-step] {
    display: contents !important;
  }
  .rental-step[data-step="1"] .form-actions {
    display: none;
  }
  .rental-step[data-step="2"] .rental-step-actions #rentalStepPrevBtn {
    display: none;
  }
}

.rental-device-recommendation {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(80, 178, 161, 0.22);
  background: linear-gradient(135deg, rgba(80, 178, 161, 0.06), rgba(255, 255, 255, 0.7));
  display: grid;
  gap: 8px;
}

.rental-device-recommendation[hidden] {
  display: none;
}

.rec-hint {
  font-size: 0.78rem;
  color: #1c5d52;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rec-hint-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rec-hint-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(80, 178, 161, 0.5);
}

.rec-list {
  display: grid;
  gap: 6px;
}

.rec-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(80, 178, 161, 0.18);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.rec-chip:hover,
.rec-chip:focus-visible {
  background: rgba(80, 178, 161, 0.1);
  box-shadow: 0 4px 12px rgba(80, 178, 161, 0.14);
  outline: none;
}

.rec-chip-label {
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 0;
}

.rec-chip-meta {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  min-width: 0;
}

.list.compact {
  margin-top: 12px;
}

.card,
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.card.selected {
  border-color: rgba(80, 178, 161, 0.6);
  box-shadow: inset 0 0 0 1px rgba(80, 178, 161, 0.25);
}

.item-info {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.card.selectable {
  cursor: pointer;
}

.card.selectable:hover {
  box-shadow: 0 10px 18px rgba(28, 22, 12, 0.12);
}

.list-item .actions {
  flex-wrap: wrap;
}

.device-title {
  font-weight: 600;
}

.device-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.ownership-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(80, 178, 161, 0.28);
  background: rgba(80, 178, 161, 0.12);
  color: #28584f;
  font-size: 0.75rem;
  font-weight: 700;
}

.ownership-partner {
  border-color: rgba(241, 149, 126, 0.34);
  background: rgba(241, 149, 126, 0.16);
  color: #7a3c2b;
}

.device-type-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--type-border, rgba(27, 26, 23, 0.14));
  background: var(--type-bg, rgba(27, 26, 23, 0.06));
  color: var(--type-text, #5c5347);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}

.device-status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(27, 26, 23, 0.12);
  padding: 3px 8px;
  color: #5c5347;
  background: rgba(27, 26, 23, 0.05);
  font-size: 0.75rem;
  font-weight: 700;
}

.device-status-available {
  color: #1c5d52;
  border-color: rgba(80, 178, 161, 0.28);
  background: rgba(80, 178, 161, 0.12);
}

.device-status-maintenance {
  color: #7a5700;
  border-color: rgba(246, 196, 83, 0.36);
  background: rgba(246, 196, 83, 0.16);
}

.device-status-disabled,
.device-status-lost {
  color: #7c332c;
  border-color: rgba(210, 93, 74, 0.26);
  background: rgba(210, 93, 74, 0.1);
}

.card.device-unrentable {
  opacity: 0.72;
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-pending {
  background: rgba(246, 196, 83, 0.22);
  color: #7a5700;
  border-color: rgba(246, 196, 83, 0.4);
}

.badge-active {
  background: rgba(80, 178, 161, 0.18);
  color: #1c5d52;
  border-color: rgba(80, 178, 161, 0.4);
}

.badge-return {
  background: rgba(241, 149, 126, 0.2);
  color: #8a4331;
  border-color: rgba(241, 149, 126, 0.36);
}

.badge-received {
  background: rgba(27, 26, 23, 0.08);
  color: #5c5347;
  border-color: rgba(27, 26, 23, 0.12);
}

.badge-best {
  background: rgba(80, 178, 161, 0.18);
  color: #1c5d52;
  border-color: rgba(80, 178, 161, 0.4);
}

.badge-match {
  background: rgba(90, 144, 227, 0.16);
  color: #1f4e8e;
  border-color: rgba(90, 144, 227, 0.34);
}

.badge-gap {
  background: rgba(246, 196, 83, 0.2);
  color: #7a5700;
  border-color: rgba(246, 196, 83, 0.34);
}

.badge-open {
  background: rgba(27, 26, 23, 0.08);
  color: #5c5347;
  border-color: rgba(27, 26, 23, 0.14);
}

.badge-conflict {
  background: rgba(241, 149, 126, 0.2);
  color: #8a4331;
  border-color: rgba(241, 149, 126, 0.36);
}

.badge-insurance {
  background: rgba(80, 178, 161, 0.1);
  color: #1c5d52;
  border-color: rgba(80, 178, 161, 0.24);
}

.card.rental-highlight {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92)),
    var(--surface-strong);
}

.card.rental-highlight.highlight-pending {
  border-color: rgba(246, 196, 83, 0.52);
  box-shadow: inset 4px 0 0 rgba(246, 196, 83, 0.9);
}

.card.rental-highlight.highlight-active {
  border-color: rgba(80, 178, 161, 0.55);
  box-shadow: inset 4px 0 0 rgba(80, 178, 161, 0.92);
}

.card.rental-highlight.highlight-return {
  border-color: rgba(241, 149, 126, 0.52);
  box-shadow: inset 4px 0 0 rgba(241, 149, 126, 0.9);
}

.actions {
  display: flex;
  gap: 8px;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.list-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.availability-query {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(90, 144, 227, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(90, 144, 227, 0.08), rgba(255, 255, 255, 0.64)),
    var(--surface-strong);
}

.availability-query-copy {
  display: grid;
  gap: 4px;
}

.availability-query h3,
.availability-query p {
  margin: 0;
}

.availability-filter-row {
  align-items: end;
}

.availability-actions {
  align-items: center;
}

.availability-list-header {
  margin-top: 4px;
}

.availability-list {
  margin-top: 0;
}

.availability-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  margin-top: 14px;
  font-weight: 700;
  font-size: 0.88rem;
}

.availability-section-header:first-child {
  margin-top: 4px;
}

.availability-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.availability-section-match .availability-section-label {
  color: #1c5d52;
}

.availability-section-gap .availability-section-label {
  color: #6f5000;
}

.availability-section-conflict .availability-section-label {
  color: #8a4331;
}

.availability-section-count {
  min-width: 32px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0 10px;
}

.availability-section-match {
  background: rgba(80, 178, 161, 0.1);
  border: 1px solid rgba(80, 178, 161, 0.22);
}

.availability-section-match .availability-section-count {
  background: rgba(80, 178, 161, 0.18);
  color: #1c5d52;
}

.availability-section-gap {
  background: rgba(246, 196, 83, 0.1);
  border: 1px solid rgba(246, 196, 83, 0.24);
}

.availability-section-gap .availability-section-count {
  background: rgba(246, 196, 83, 0.22);
  color: #7a5700;
}

.availability-section-conflict {
  background: rgba(241, 149, 126, 0.1);
  border: 1px solid rgba(241, 149, 126, 0.22);
}

.availability-section-conflict .availability-section-count {
  background: rgba(241, 149, 126, 0.2);
  color: #8a4331;
}

.availability-item {
  align-items: flex-start;
}

.availability-item.is-top-pick {
  border-color: rgba(80, 178, 161, 0.42);
  box-shadow: inset 0 0 0 1px rgba(80, 178, 161, 0.14);
}

.availability-item-info {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.availability-device-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.availability-lines {
  display: grid;
  gap: 4px;
  font-size: 0.84rem;
  color: var(--muted);
}

.availability-line.strong {
  color: #7a3c2b;
  font-weight: 600;
}

.availability-line.conflict {
  color: #8b2f20;
}

.availability-gap-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.availability-gap-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(90, 144, 227, 0.24);
  background: rgba(90, 144, 227, 0.08);
  color: #355985;
  font-size: 0.76rem;
  line-height: 1.35;
}

.availability-gap-chip.is-match {
  border-color: rgba(80, 178, 161, 0.42);
  background: rgba(80, 178, 161, 0.16);
  color: #21574f;
  font-weight: 700;
}

.availability-gap-chip.is-more {
  border-style: dashed;
  background: rgba(27, 26, 23, 0.04);
  color: #5f4f46;
}

.availability-actions .button {
  white-space: nowrap;
}

.availability-order-search {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(80, 178, 161, 0.26);
}

.availability-order-search-copy {
  display: grid;
  gap: 4px;
}

.availability-order-search h3,
.availability-order-search p {
  margin: 0;
}

.rental-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.rental-search input {
  width: 100%;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  transition: background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.checkbox-label:hover {
  background: rgba(80, 178, 161, 0.06);
  border-color: rgba(80, 178, 161, 0.18);
}

.checkbox-label:has(input:checked) {
  background: rgba(80, 178, 161, 0.08);
  border-color: rgba(80, 178, 161, 0.22);
  color: var(--ink);
}

.checkbox-label input[type="checkbox"] {
  min-height: auto;
  width: 16px;
  height: 16px;
  accent-color: rgba(80, 178, 161, 0.6);
  cursor: pointer;
}

.rental-search .button {
  white-space: nowrap;
}

@media (min-width: 681px) {
  .device-panel,
  .rental-panel {
    height: auto;
  }

  .panel-body {
    overflow: visible;
    padding-right: 0;
    scrollbar-gutter: auto;
  }

  .rental-panel.is-searching #rentalList {
    max-height: none;
    overflow: visible;
    padding-right: 0;
    scrollbar-gutter: auto;
  }
}

.slot-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
  border: 1px solid transparent;
}

.slot-chip.free {
  background: rgba(80, 178, 161, 0.18);
  color: #1c5d52;
  border-color: rgba(80, 178, 161, 0.4);
}

.slot-chip.busy {
  background: rgba(241, 149, 126, 0.2);
  color: #7a3c2b;
  border-color: rgba(241, 149, 126, 0.4);
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-window-selector {
  display: flex;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  background: rgba(27, 26, 23, 0.04);
}

.window-day-btn {
  border-radius: 999px;
  border: 1px solid transparent;
  min-height: 32px;
  padding: 4px 12px;
}

.window-day-btn.is-active {
  background: var(--accent);
  color: #3d2c06;
  border-color: rgba(246, 196, 83, 0.4);
  box-shadow: 0 4px 10px rgba(246, 196, 83, 0.22);
}

.calendar-wrap {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.device-calendar {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  background: var(--surface-strong);
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.device-calendar-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 0;
}

.device-month {
  display: grid;
  gap: 6px;
}

.device-month-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.device-calendar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.device-calendar-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.device-calendar-title {
  font-weight: 600;
}

.device-calendar-jump {
  width: fit-content;
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
  text-decoration: underline dotted rgba(80, 178, 161, 0.45);
  text-underline-offset: 4px;
}

.device-calendar-jump:hover,
.device-calendar-jump:focus-visible {
  color: #27685e;
  outline: none;
  text-decoration-color: rgba(80, 178, 161, 0.85);
}

.device-calendar-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.device-calendar-summary {
  font-size: 0.78rem;
  color: #7a3c2b;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.device-calendar-metrics {
  font-size: 0.76rem;
  color: #28584f;
  line-height: 1.3;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.device-calendar.has-short-gap {
  border-color: rgba(246, 196, 83, 0.38);
  box-shadow: inset 3px 0 0 rgba(246, 196, 83, 0.55);
}

.device-calendar.has-short-gap .device-calendar-metrics {
  color: #7a5700;
}

.device-calendar.collapsed .device-calendar-body {
  display: none;
}

.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-filter-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(27, 26, 23, 0.06);
}

.calendar-filter-select {
  min-height: 34px;
  border-radius: 10px;
  padding: 6px 32px 6px 10px;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--ink);
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #3b3322 50%),
    linear-gradient(135deg, #3b3322 50%, transparent 50%),
    linear-gradient(to right, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.08));
  background-position:
    calc(100% - 14px) 55%,
    calc(100% - 9px) 55%,
    calc(100% - 24px) 50%;
  background-size: 5px 5px, 5px 5px, 1px 50%;
  background-repeat: no-repeat;
}

.calendar-filter-input {
  min-height: 34px;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--ink);
  width: 100%;
}

.calendar-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  transition: background 0.15s ease;
}

.calendar-filter-toggle:hover {
  background: rgba(80, 178, 161, 0.08);
}

.calendar-filter-toggle input[type="checkbox"] {
  min-height: auto;
  accent-color: rgba(80, 178, 161, 0.8);
}

.calendar-filter-toggle:has(input:checked) {
  background: rgba(80, 178, 161, 0.12);
  border-color: rgba(80, 178, 161, 0.32);
  color: #1c5d52;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 12px;
}

.month-label {
  font-weight: 600;
  font-size: 1.1rem;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.calendar-weekdays div {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding: 4px 0;
}

.day {
  min-height: 74px;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 6px;
  background: var(--surface-strong);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  min-width: 0;
}

.day.empty {
  background: transparent;
  border: 1px dashed rgba(0, 0, 0, 0.08);
}

.day.today {
  border-color: rgba(80, 178, 161, 0.8);
  box-shadow: inset 0 0 0 1px rgba(80, 178, 161, 0.35);
}

.day-number {
  font-weight: 600;
  font-size: 0.78rem;
}

.slots {
  display: grid;
  gap: 4px;
}

.slot-button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 6px;
  font-size: 0.6rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.1;
  width: 100%;
  position: relative;
}

.slot-button.free {
  background: rgba(80, 178, 161, 0.18);
  color: #1c5d52;
  border-color: rgba(80, 178, 161, 0.4);
}

.slot-button.busy {
  background: rgba(241, 149, 126, 0.2);
  color: #7a3c2b;
  border-color: rgba(241, 149, 126, 0.4);
}

.slot-button.busy.range-start::after,
.slot-button.busy.range-end::after,
.slot-button.busy.range-single::after,
.slot-button.busy.range-middle::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7a3c2b;
  transform: translateY(-50%);
  opacity: 0.75;
}

.slot-button.busy.range-start::after {
  right: 4px;
}

.slot-button.busy.range-end::after {
  left: 4px;
}

.slot-button.busy.range-middle::after {
  left: 4px;
  box-shadow: calc(100% - 8px) 0 0 0 #7a3c2b;
}

.slot-button.busy.range-single::after {
  left: 50%;
  transform: translate(-50%, -50%);
}

.slot-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.calendar-empty {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  display: none;
}

/* ── 日历快速录单浮层 ── */
.quick-entry-popup {
  margin-top: 12px;
  border: 1px solid rgba(80, 178, 161, 0.4);
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: 0 12px 32px rgba(34, 30, 22, 0.18);
  animation: quickEntrySlideUp 0.25s ease;
  overflow: hidden;
}

.quick-entry-popup[hidden] {
  display: none;
}

@keyframes quickEntrySlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quick-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(80, 178, 161, 0.08);
  border-bottom: 1px solid rgba(80, 178, 161, 0.14);
}

.quick-entry-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1c5d52;
}

.quick-entry-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.quick-entry-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.quick-entry-body {
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.quick-entry-device,
.quick-entry-date {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.quick-entry-device {
  font-weight: 600;
  color: var(--ink);
}

.quick-entry-fields {
  display: grid;
  gap: 8px;
}

.quick-entry-fields input {
  width: 100%;
  min-height: 38px;
  font-size: 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--ink);
  padding: 8px 12px;
}

.quick-entry-fields input:focus {
  outline: 2px solid rgba(80, 178, 161, 0.4);
  border-color: rgba(80, 178, 161, 0.6);
}

.quick-entry-actions {
  display: flex;
  gap: 8px;
}

/* ── 提醒通知横条 ── */
.reminder-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(246, 196, 83, 0.95), rgba(241, 149, 126, 0.92));
  color: #3d2c06;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(34, 30, 22, 0.2);
  cursor: pointer;
  animation: toastSlideDown 0.35s ease;
  user-select: none;
}

.reminder-toast[hidden] {
  display: none;
}

@keyframes toastSlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.reminder-toast-text {
  flex: 0 1 auto;
  text-align: center;
  line-height: 1.4;
}

.reminder-toast-close {
  flex: 0 0 auto;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: #3d2c06;
  transition: background 0.15s ease;
}

.reminder-toast-close:hover {
  background: rgba(0, 0, 0, 0.18);
}

/* ── 撤销操作条 ── */
.undo-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  font-size: 0.88rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  animation: undoSlideUp 0.3s ease;
}

.undo-bar[hidden] {
  display: none;
}

@keyframes undoSlideUp {
  from {
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.undo-bar-text {
  flex: 0 1 auto;
}

.undo-bar-btn {
  color: var(--accent) !important;
  border-color: rgba(246, 196, 83, 0.4) !important;
  font-weight: 700;
}

.undo-bar-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
}

.undo-bar-close:hover {
  color: #fff;
}

.reminder-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(340px, 92vw);
  max-height: 60vh;
  overflow: auto;
  border-radius: 20px;
  border: 2px solid rgba(214, 84, 57, 0.28);
  background: linear-gradient(
    180deg,
    rgba(255, 248, 241, 0.98),
    rgba(255, 255, 255, 0.96)
  );
  box-shadow:
    0 24px 54px rgba(51, 30, 18, 0.22),
    0 8px 24px rgba(214, 84, 57, 0.08);
  padding: 12px 14px;
  display: grid;
  gap: 10px;
  z-index: 50;
  backdrop-filter: blur(10px);
  will-change: transform, box-shadow;
}

.reminder-panel.has-alert {
  border-color: rgba(214, 84, 57, 0.72);
  box-shadow:
    0 28px 56px rgba(51, 30, 18, 0.24),
    0 0 0 4px rgba(214, 84, 57, 0.14),
    0 0 28px rgba(214, 84, 57, 0.34);
  animation: reminderPulse 1.2s ease-in-out infinite;
}

.reminder-panel.pulse-once {
  animation: reminderPulseOnce 0.6s ease-in-out 2;
}

@keyframes reminderPulseOnce {
  0%, 100% {
    box-shadow:
      0 28px 56px rgba(51, 30, 18, 0.24),
      0 0 0 4px rgba(214, 84, 57, 0.14),
      0 0 28px rgba(214, 84, 57, 0.34);
  }
  50% {
    box-shadow:
      0 28px 56px rgba(51, 30, 18, 0.24),
      0 0 0 10px rgba(214, 84, 57, 0.28),
      0 0 38px rgba(214, 84, 57, 0.5);
  }
}

@keyframes reminderPulse {
  0% {
    transform: translateY(0);
    box-shadow:
      0 28px 56px rgba(51, 30, 18, 0.24),
      0 0 0 4px rgba(214, 84, 57, 0.14),
      0 0 22px rgba(214, 84, 57, 0.26);
  }
  50% {
    transform: translateY(-2px);
    box-shadow:
      0 30px 60px rgba(51, 30, 18, 0.26),
      0 0 0 8px rgba(214, 84, 57, 0.08),
      0 0 36px rgba(214, 84, 57, 0.42);
  }
  100% {
    transform: translateY(0);
    box-shadow:
      0 28px 56px rgba(51, 30, 18, 0.24),
      0 0 0 4px rgba(214, 84, 57, 0.14),
      0 0 22px rgba(214, 84, 57, 0.26);
  }
}

.reminder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reminder-title {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #8b2f20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.reminder-title::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(214, 84, 57, 0.42);
}

.reminder-panel.has-alert .reminder-title::before {
  background: #d65439;
  box-shadow: 0 0 0 6px rgba(214, 84, 57, 0.18);
}

.reminder-count {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 232, 225, 0.98), rgba(255, 242, 238, 0.98));
  color: #8b2f20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid rgba(214, 84, 57, 0.32);
  box-shadow: 0 6px 14px rgba(214, 84, 57, 0.14);
}

.reminder-list {
  display: grid;
  gap: 10px;
}

.reminder-group {
  display: grid;
  gap: 8px;
}

.reminder-group-header {
  width: 100%;
  border: 1px solid rgba(214, 84, 57, 0.35);
  border-radius: 14px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(255, 245, 239, 0.95), rgba(255, 255, 255, 0.95));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.reminder-group[data-type="start"] .reminder-group-header {
  border-color: rgba(246, 196, 83, 0.52);
  background: linear-gradient(180deg, rgba(255, 249, 226, 0.98), rgba(255, 255, 255, 0.94));
}

.reminder-group[data-type="end"] .reminder-group-header {
  border-color: rgba(214, 84, 57, 0.4);
  background: linear-gradient(180deg, rgba(255, 238, 232, 0.98), rgba(255, 255, 255, 0.94));
}

.reminder-group-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.reminder-group-count {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(214, 84, 57, 0.16);
  color: #8b2f20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.reminder-group[data-type="start"] .reminder-group-count {
  background: rgba(246, 196, 83, 0.24);
  color: #7a5700;
}

.reminder-group[data-type="end"] .reminder-group-count {
  background: rgba(214, 84, 57, 0.18);
  color: #8b2f20;
}

.reminder-group-toggle {
  font-size: 0.75rem;
  color: #6a5b50;
  font-weight: 600;
}

.reminder-group.collapsed .reminder-list {
  display: none;
}

.reminder-item {
  border: 1px solid rgba(214, 84, 57, 0.14);
  border-radius: 16px;
  padding: 12px 12px 12px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 249, 243, 0.96));
  display: grid;
  gap: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(34, 30, 22, 0.08);
}

.reminder-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: transparent;
}

.reminder-item.start {
  border-color: rgba(246, 196, 83, 0.52);
  background: linear-gradient(135deg, rgba(255, 249, 228, 0.98), rgba(255, 255, 255, 0.96));
  box-shadow: 0 12px 24px rgba(246, 196, 83, 0.16);
}

.reminder-item.start::before {
  background: linear-gradient(180deg, #f6c453, #dfa217);
}

.reminder-item.end {
  border-color: rgba(214, 84, 57, 0.38);
  background: linear-gradient(135deg, rgba(255, 238, 232, 0.98), rgba(255, 255, 255, 0.96));
  box-shadow: 0 12px 24px rgba(214, 84, 57, 0.14);
}

.reminder-item.end::before {
  background: linear-gradient(180deg, #f1957e, #d65439);
}

.reminder-item-title {
  font-weight: 800;
  font-size: 1rem;
  color: #3c2418;
}

.reminder-item-meta,
.reminder-item-range,
.reminder-item-person {
  font-size: 0.82rem;
  color: #5f4f46;
  line-height: 1.35;
}

.reminder-item-range {
  font-weight: 700;
  color: #8b2f20;
}

.reminder-item .actions {
  margin-top: 4px;
}

.reminder-item .button.ghost {
  font-weight: 700;
  border-width: 1px;
  background: rgba(255, 255, 255, 0.72);
}

.reminder-item.start .button.ghost {
  border-color: rgba(246, 196, 83, 0.64);
  color: #6f5000;
  background: rgba(246, 196, 83, 0.18);
}

.reminder-item.end .button.ghost {
  border-color: rgba(214, 84, 57, 0.42);
  color: #8b2f20;
  background: rgba(214, 84, 57, 0.12);
}

.reminder-item .button.ghost:disabled {
  background: rgba(27, 26, 23, 0.06);
  color: #736a5d;
  border-color: rgba(27, 26, 23, 0.12);
}

.reminder-batch-btn {
  margin-top: 8px;
  width: 100%;
}

.reminder-batch-btn[hidden] {
  display: none;
}

.reminder-empty {
  font-size: 0.85rem;
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(27, 26, 23, 0.44);
  backdrop-filter: blur(10px);
  z-index: 80;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 28px 56px rgba(34, 30, 22, 0.22);
  display: grid;
  gap: 16px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.35rem;
}

.modal-copy {
  margin: 6px 0 0;
  line-height: 1.5;
}

.modal-actions .button {
  width: 100%;
}

.order-modal-card {
  width: min(720px, 100%);
}

.order-stats-list {
  display: grid;
  gap: 10px;
  max-height: min(58vh, 520px);
  overflow: auto;
  padding-right: 2px;
}

.order-stats-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-strong);
}

.order-stats-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}

.order-stats-item-meta,
.order-stats-item-range {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.order-stats-empty {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  text-align: center;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.delay-1 {
  animation-delay: 0.05s;
}

.delay-2 {
  animation-delay: 0.12s;
}

.delay-3 {
  animation-delay: 0.18s;
}

@media (max-width: 980px) {
  .hero {
    flex-direction: column;
  }

  .hero-text {
    flex: none;
  }

  .hero-meta {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-card {
    grid-column: 1 / -1;
  }

  .grid {
    grid-template-columns: 1fr;
    min-width: 0;
    max-width: 100%;
  }

  .calendar-panel {
    grid-column: span 1;
  }

  .calendar-wrap {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .device-calendar-body {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1180px) {
  .hero-meta {
    width: min(100%, 820px);
  }
}

@media (max-width: 680px) {
  .app {
    max-width: 100%;
    overflow-x: hidden;
    padding: 14px 10px calc(116px + env(safe-area-inset-bottom));
  }

  .main-tabs {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    padding: 7px;
    border: 1px solid rgba(27, 26, 23, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 36px rgba(34, 30, 22, 0.18);
    backdrop-filter: blur(14px);
  }

  .mobile-nav-item {
    min-width: 0;
    min-height: 52px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
  }

  .mobile-nav-item.active {
    background: var(--ink);
    color: #fff;
  }

  .mobile-nav-icon {
    font-size: 1rem;
    line-height: 1;
  }

  .undo-bar {
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: min(92vw, 420px);
    justify-content: center;
  }

  .hero {
    gap: 16px;
    margin-bottom: 20px;
  }

  .hero-text h1 {
    font-size: clamp(2rem, 8vw, 2.3rem);
    line-height: 1.05;
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }

  .data-card {
    grid-column: auto;
  }

  .summary-card,
  .panel {
    padding: 16px;
    border-radius: 18px;
  }

  .summary-split {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .panel-header h2 {
    font-size: 1.3rem;
  }

  .form {
    gap: 14px;
  }

  label {
    font-size: 0.88rem;
  }

  input,
  select {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px;
  }

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

  .form-actions .button {
    width: 100%;
  }

  .button {
    min-height: 46px;
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .button.small {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .rental-search {
    grid-template-columns: 1fr;
  }

  .rental-search .button {
    width: 100%;
  }

  .availability-actions {
    grid-template-columns: 1fr;
  }

  .availability-list-header {
    align-items: flex-start;
  }

  .availability-item {
    gap: 10px;
  }

  .card,
  .list-item {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }

  .actions,
  .list-item .actions {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 2px;
  }

  .actions .button {
    flex: 1 1 92px;
    min-width: 0;
    white-space: normal;
  }

  .calendar-controls {
    width: 100%;
  }

  .calendar-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-nav .button {
    width: 100%;
  }

  .calendar-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .calendar-wrap {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .device-calendar {
    padding: 12px;
    border-radius: 18px;
  }

  .device-calendar-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .device-calendar-body {
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 1fr);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .device-month {
    min-width: 280px;
    scroll-snap-align: start;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 6px;
  }

  .day {
    min-height: 92px;
    padding: 8px;
  }

  .slot-button {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .reminder-panel {
    position: static;
    right: auto;
    left: auto;
    bottom: auto;
    width: auto;
    max-height: none;
    margin: 0 0 14px;
    border-radius: 18px;
    box-shadow:
      0 18px 36px rgba(51, 30, 18, 0.16),
      0 6px 16px rgba(214, 84, 57, 0.06);
  }

  .modal-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .modal-card {
    width: 100%;
    border-radius: 20px 20px 16px 16px;
    padding: 16px;
  }

  .order-stats-list {
    max-height: 62vh;
  }

  .modal-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .reminder-group-header {
    flex-wrap: wrap;
  }

  .reminder-item .actions .button {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .device-panel,
  .rental-panel {
    height: auto;
  }

  .panel-body {
    overflow: visible;
    padding-right: 0;
    scrollbar-gutter: auto;
  }

  .mobile-device-toolbar {
    display: none;
  }

  .mobile-device-trigger {
    background:
      linear-gradient(135deg, rgba(255, 249, 238, 0.98), rgba(255, 255, 255, 0.95)),
      var(--surface);
    box-shadow:
      0 20px 40px rgba(51, 30, 18, 0.12),
      0 6px 18px rgba(241, 149, 126, 0.08);
  }

  .mobile-device-trigger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .rental-panel {
    order: 2;
  }

  /* 移动端分步表单 */
  .rental-step-indicator {
    display: flex;
  }

  .calendar-panel {
    order: 2;
    grid-column: span 1;
  }

  .device-panel {
    order: 1;
    margin-bottom: 2px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(60, 45, 20, 0.1);
    background:
      linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(255, 255, 255, 0.94)),
      var(--surface);
    box-shadow:
      0 20px 36px rgba(51, 30, 18, 0.12),
      0 6px 14px rgba(51, 30, 18, 0.05);
  }

  body:not(.device-drawer-open) .device-panel {
    display: grid;
  }

  .device-panel-close {
    display: none;
  }

  .device-panel .panel-header {
    min-width: 0;
    max-width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(60, 45, 20, 0.08);
  }

  .device-panel #deviceList {
    order: 1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-top: 0;
    overflow: hidden;
    padding-bottom: 18px;
  }

  .device-panel #deviceForm {
    order: 2;
  }

  .device-panel-body {
    min-width: 0;
    max-width: 100%;
    gap: 14px;
  }

  .device-panel .card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    padding: 12px;
    border-radius: 14px;
  }

  .device-panel .item-info {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .device-title,
  .device-meta {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.45;
  }

  .device-panel .ownership-badge,
  .device-panel .device-type-badge,
  .device-panel .device-status-badge,
  .device-panel .status-badge {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .device-panel .status-badges {
    min-width: 0;
    max-width: 100%;
  }

  .device-panel .actions {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
    gap: 8px;
  }

  .device-panel .actions .button {
    flex: 1 1 88px;
    min-width: 0;
  }

  .device-panel .form-row,
  .rental-panel .form-row,
  .availability-query .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .device-panel .field,
  .rental-panel .field {
    min-width: 0;
  }

  .device-panel .form-actions,
  .rental-step-actions,
  .availability-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .availability-actions {
    grid-template-columns: 1fr;
  }

  .device-panel .form-actions .button,
  .rental-step-actions .button,
  .availability-actions .button {
    width: 100%;
  }

  .rental-step[data-step="2"] .rental-step-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rental-date-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .rental-date-shortcuts .button {
    width: 100%;
    padding-inline: 8px;
  }

  .availability-query {
    padding: 14px;
    margin-top: 12px;
    border-radius: 16px;
  }

  .availability-order-search {
    gap: 10px;
  }

  .rental-search {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .rental-search input {
    min-width: 0;
  }

  .list,
  .list.compact {
    min-width: 0;
  }

  .card,
  .list-item {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .card > div,
  .list-item > div {
    min-width: 0;
  }

  .drawer-backdrop {
    display: none;
  }

  .device-calendar-header .button[data-action="toggle"] {
    display: none;
  }

  .calendar-wrap {
    gap: 10px;
  }

  .device-calendar {
    padding: 14px;
    border-radius: 20px;
    width: 100%;
    min-width: 0;
  }

  .device-calendar-body {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: visible;
    overscroll-behavior-x: auto;
    scroll-snap-type: none;
    padding-bottom: 0;
    gap: 10px;
  }

  .device-month {
    min-width: 0;
    width: 100%;
    scroll-snap-align: none;
  }

  .device-calendar-info,
  .device-calendar-title,
  .device-calendar-meta,
  .device-calendar-summary,
  .device-calendar-metrics {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 4px;
  }

  .calendar-weekdays div {
    font-size: 0.68rem;
    padding: 2px 0;
  }

  .day {
    min-height: 62px;
    padding: 4px;
    border-radius: 10px;
  }

  .slot-button {
    min-height: 24px;
    padding: 3px 4px;
    border-radius: 8px;
    font-size: 0.68rem;
  }

  .device-panel .button,
  .rental-panel .button {
    min-width: 0;
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .form-actions {
    grid-template-columns: 1fr;
  }

  .device-panel .form-row,
  .rental-panel .form-row,
  .availability-query .form-row {
    grid-template-columns: 1fr;
  }

  .rental-step[data-step="2"] .rental-step-actions {
    grid-template-columns: 1fr;
  }

  .availability-query {
    padding: 14px;
  }

  .calendar-nav {
    grid-template-columns: 1fr;
  }

  .device-month {
    min-width: 0;
  }
}

/* ===== Dashboard ===== */

.dashboard {
  margin-bottom: 24px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.dashboard-title {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.3rem;
  margin: 0;
  color: var(--ink);
}

.dashboard-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.dashboard-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.dashboard-tab.active {
  background: var(--accent);
  color: #3d2c06;
}

.dashboard-tab:hover:not(.active) {
  background: rgba(246, 196, 83, 0.12);
}

.dashboard-ownership-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-strong);
  border: 1px solid rgba(60, 45, 20, 0.12);
  border-radius: 999px;
  padding: 2px;
}

.dashboard-ownership-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.dashboard-ownership-tab.active {
  background: rgba(90, 144, 227, 0.16);
  color: #1f4e8e;
}

.dashboard-ownership-tab:hover:not(.active) {
  background: rgba(90, 144, 227, 0.06);
}

.dashboard-body {
  transition: max-height 0.35s ease, opacity 0.3s ease;
  overflow: hidden;
}

.dashboard-body.collapsed {
  max-height: 0;
  opacity: 0;
}

.dashboard-pane[hidden] {
  display: none;
}

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

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.dashboard-card-title {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.chart-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

/* Vertical bar chart */

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 160px;
  padding-top: 8px;
}

.chart-bar-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}

.chart-bar-label {
  font-size: 0.62rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.chart-bar-value {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

/* Horizontal bar chart */

.chart-hbars {
  display: grid;
  gap: 8px;
}

.chart-hbar-row {
  display: grid;
  grid-template-columns: 72px 1fr 52px;
  align-items: center;
  gap: 8px;
}

.chart-hbar-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-hbar-track {
  height: 18px;
  border-radius: 9px;
  background: rgba(27, 26, 23, 0.06);
  overflow: hidden;
}

.chart-hbar-fill {
  height: 100%;
  border-radius: 9px;
  transition: width 0.4s ease;
}

.chart-hbar-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
}

/* Donut chart */

.chart-donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 4px 0;
}

.chart-donut {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-donut-legend {
  display: grid;
  gap: 8px;
}

.chart-donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.chart-donut-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.chart-donut-label {
  color: var(--muted);
}

.chart-donut-value {
  font-weight: 700;
  margin-left: auto;
}

/* Ranking list */

.chart-ranking {
  display: grid;
  gap: 6px;
}

.chart-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
}

.chart-rank-num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(27, 26, 23, 0.06);
  color: var(--muted);
}

.chart-rank-num.top {
  background: var(--accent);
  color: #3d2c06;
}

.chart-rank-label {
  flex: 1 1 auto;
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-rank-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #3d2c06;
  flex-shrink: 0;
}

/* Dashboard empty state */

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 100px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Dashboard responsive */

@media (max-width: 980px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .chart-bars {
    height: 130px;
  }

  .chart-hbar-row {
    grid-template-columns: 56px 1fr 44px;
  }

  .chart-donut-wrap {
    flex-direction: column;
    gap: 12px;
  }
}

/* ── 订单总览面板 ── */
.order-overview {
  margin-bottom: 24px;
}

.order-overview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.order-overview-title {
  font-family: "Fraunces", "Times New Roman", serif;
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0;
  color: var(--ink);
  flex-shrink: 0;
}

.order-overview-ownership-tabs {
  display: flex;
  gap: 0;
  background: var(--surface);
  border-radius: 12px;
  padding: 3px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.order-overview-ownership-tab {
  padding: 6px 16px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.order-overview-ownership-tab.active {
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(246, 196, 83, 0.5);
}

.order-overview-body {
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

.order-overview-body.collapsed {
  max-height: 0;
  opacity: 0;
}

/* 统计条 */
.order-overview-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 12px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  font-size: 0.92rem;
}

.order-overview-stats .stat-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-overview-stats .stat-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

.order-overview-stats .stat-label {
  font-weight: 500;
  color: var(--muted);
}

.order-overview-stats .stat-value {
  font-weight: 700;
  color: var(--ink);
}

.order-overview-stats .stat-value.owned {
  color: #28584f;
}

.order-overview-stats .stat-value.partner {
  color: #5a3678;
}

/* 搜索框 */
.order-overview-search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.order-overview-search input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}

.order-overview-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.2);
}

/* 日期筛选 */
.order-overview-date-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.date-filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}

.date-filter-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--surface);
  color: var(--ink);
  min-width: 140px;
}

.date-filter-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.2);
}

.date-filter-sep {
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 680px) {
  .order-overview-date-filter {
    gap: 6px;
  }
  .date-filter-input {
    min-width: 120px;
    font-size: 0.82rem;
  }
}

/* 表格 */
.order-overview-table-wrap {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.order-overview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.order-overview-table thead {
  background: rgba(27, 26, 23, 0.04);
  border-bottom: 2px solid var(--border);
}

.order-overview-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.order-overview-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.order-overview-table th.sortable:hover {
  color: var(--ink);
}

.order-overview-table th.sortable .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7rem;
  color: var(--accent);
}

.order-overview-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(27, 26, 23, 0.06);
  vertical-align: middle;
}

.order-overview-table tbody tr:last-child td {
  border-bottom: none;
}

.order-overview-table tbody tr:hover {
  background: rgba(246, 196, 83, 0.06);
}

.order-overview-table .col-name { min-width: 80px; }
.order-overview-table .col-device { min-width: 100px; }
.order-overview-table .col-date { min-width: 200px; }
.order-overview-table .col-amount { min-width: 80px; text-align: right; }
.order-overview-table .col-wechat { min-width: 100px; }
.order-overview-table .col-phone { min-width: 110px; }
.order-overview-table .col-channel { min-width: 70px; text-align: center; }
.order-overview-table .col-status { min-width: 70px; text-align: center; }
.order-overview-table .col-insurance { min-width: 60px; text-align: center; }
.order-overview-table .col-actions { min-width: 60px; text-align: center; }

.order-overview-table .cell-amount {
  font-weight: 600;
  text-align: right;
}

.order-overview-table .cell-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.order-overview-table .cell-status.completed {
  background: rgba(80, 178, 161, 0.14);
  color: #1c5d52;
}

.order-overview-table .cell-status.active {
  background: rgba(246, 196, 83, 0.2);
  color: #7a5700;
}

.order-overview-table .cell-status.return {
  background: rgba(210, 93, 74, 0.12);
  color: #7c332c;
}

.order-overview-table .cell-status.pending {
  background: rgba(90, 144, 227, 0.12);
  color: #1f4e8e;
}

.order-overview-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

/* 响应式 */
@media (max-width: 980px) {
  .taskboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .taskboard-grid {
    grid-template-columns: 1fr;
  }

  .taskboard-header,
  .order-workbench-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-overview-table .col-wechat,
  .order-overview-table .col-phone,
  .order-overview-table .col-channel,
  .order-overview-table .col-insurance {
    display: none;
  }
}

@media (max-width: 680px) {
  .taskboard-header h1,
  .order-workbench-header h1 {
    font-size: 1.6rem;
  }

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

  .taskboard-actions,
  .order-status-filter {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .taskboard-actions .button,
  .order-status-tab {
    flex: 0 0 auto;
    min-height: 44px;
  }

  .task-item {
    grid-template-columns: 1fr;
  }

  .task-item-actions {
    justify-content: flex-start;
  }

  .order-overview-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .order-workbench {
    gap: 12px;
  }

  .order-overview {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .order-overview-body {
    display: grid;
    gap: 12px;
    min-width: 0;
  }

  .order-overview-search {
    display: grid;
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .order-overview-search input {
    min-width: 0;
  }

  .order-overview-search .button {
    width: 100%;
  }

  .order-overview-date-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(58px, auto);
    align-items: end;
    gap: 6px;
    min-width: 0;
  }

  .date-filter-label {
    grid-column: 1 / -1;
  }

  .date-filter-input {
    width: 100%;
    min-width: 0;
    padding: 8px 6px;
    font-size: 0.78rem;
  }

  .date-filter-sep {
    grid-column: auto;
    align-self: center;
    font-size: 0.78rem;
  }

  .order-overview-date-filter .button {
    grid-column: auto;
    width: auto;
    min-width: 58px;
    padding-inline: 8px;
  }

  .order-overview-table-wrap {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .order-overview-table,
  .order-overview-table tbody,
  .order-overview-table tr,
  .order-overview-table td {
    display: block;
    width: 100%;
  }

  .order-overview-table thead {
    display: none;
  }

  .order-overview-table {
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .order-overview-table tr {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 8px 22px rgba(34, 30, 22, 0.08);
  }

  .order-overview-table td {
    position: relative;
    min-width: 0;
    min-height: 34px;
    padding: 7px 0 7px 86px;
    border-bottom: 1px solid rgba(27, 26, 23, 0.06);
    text-align: left !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .order-overview-table td:last-child {
    border-bottom: 0;
  }

  .order-overview-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    top: 8px;
    width: 72px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
  }

  .order-overview-table .cell-amount {
    text-align: left;
  }

  .order-overview-table td[data-label="操作"] {
    padding-left: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .order-overview-table td[data-label="操作"]::before {
    display: none;
  }

  .order-overview-table td[data-label="操作"] .button {
    flex: 1 1 120px;
  }

  .order-overview-stats {
    gap: 8px;
    font-size: 0.82rem;
    padding: 10px 14px;
    overflow-wrap: anywhere;
  }

  .order-overview-stats .stat-divider {
    display: none;
  }

  .order-overview-table .col-wechat,
  .order-overview-table .col-device,
  .order-overview-table .col-phone,
  .order-overview-table .col-channel,
  .order-overview-table .col-insurance,
  .order-overview-table .col-status {
    display: none;
  }

  .order-overview-table .col-date {
    min-width: 140px;
  }

  .order-overview-table th {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .order-overview-table td {
    font-size: 0.82rem;
  }
}

/* ── 收入校准 ── */
.stat-value.calibration-warn {
  color: #c2781a;
  background: rgba(246, 196, 83, 0.18);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.stat-value.calibration-ok {
  color: #1c5d52;
  background: rgba(80, 178, 161, 0.12);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
}

button.stat-value.calibration-link {
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

button.stat-value.calibration-link:hover {
  background: rgba(246, 196, 83, 0.32);
  box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.25);
}

.calibration-modal-card {
  max-width: 720px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.calibration-list {
  flex: 1;
  overflow-y: auto;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calibration-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(27, 26, 23, 0.03);
  border-radius: 10px;
  flex-wrap: wrap;
}

.calibration-item-info {
  flex: 1;
  min-width: 200px;
}

.calibration-item-name {
  font-weight: 600;
  color: var(--ink);
}

.calibration-item-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

.calibration-item-amount {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}

.calibration-item select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--ink);
  min-width: 100px;
}

.calibration-item select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.2);
}

@media (max-width: 680px) {
  .calibration-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .calibration-item-amount {
    align-self: flex-end;
  }

  .order-overview-stats .stat-divider {
    display: block;
    width: 100%;
    height: 1px;
  }

  .order-overview-stats .stat-block {
    flex-wrap: wrap;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel {
    animation: none;
  }

  .button {
    transition: none;
  }

  .reminder-panel.has-alert {
    animation: none;
  }
}

/* Unified account-console theme */
:root {
  color-scheme: dark;
  --ink: #fffaf0;
  --muted: rgba(255, 250, 240, 0.64);
  --accent: #f6e66f;
  --accent-2: #b9f3e6;
  --accent-3: #ff9974;
  --surface: rgba(255, 255, 255, 0.075);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

body {
  color: var(--ink);
  background:
    linear-gradient(145deg, #08090b 0%, #141618 42%, #090a0c 100%);
}

.ambient {
  background:
    linear-gradient(115deg, rgba(185, 243, 230, 0.12), transparent 26%),
    linear-gradient(255deg, rgba(255, 153, 116, 0.13), transparent 32%),
    linear-gradient(180deg, rgba(246, 230, 111, 0.08), rgba(0, 0, 0, 0.32));
}

.web-account-bar,
.web-account-admin,
.main-tabs,
.hero,
.summary-card,
.panel,
.task-card,
.task-metric,
.order-overview,
.order-overview-table-wrap,
.device-calendar,
.list-item,
.rental-record,
.availability-query,
.reminder-panel,
.modal-card,
.auth-card,
.calibration-item {
  color: var(--ink);
  border-color: var(--border);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.web-account-bar,
.hero,
.panel,
.summary-card,
.taskboard,
.order-workbench {
  animation: accountSurfaceIn 0.32s ease both;
}

h1,
h2,
h3,
.dashboard-title,
.summary-title,
.item-title,
.device-code,
.rental-name,
.order-overview-table td,
.order-overview-table th {
  color: var(--ink);
}

.muted,
.subtitle,
.hero .subtitle,
.data-card-copy,
.data-card-tip,
.panel-header p,
.item-meta,
.calibration-item-meta {
  color: var(--muted);
}

input,
select,
textarea,
.tenant-select,
.export-date-range,
.calendar-filter-select {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.14);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 250, 240, 0.42);
}

select option {
  color: #1b1a17;
  background: #fffaf0;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(185, 243, 230, 0.78);
  background-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(185, 243, 230, 0.12);
}

.button.primary,
.main-tab.active,
.dashboard-tab.active,
.dashboard-ownership-tab.active,
.order-overview-ownership-tab.active,
.order-status-tab.active,
.slot-toggle button.active,
.calendar-window-button.active {
  color: #201b0a;
  border-color: transparent;
  background: linear-gradient(135deg, #b9f3e6, #f6e66f 52%, #ff9974);
  box-shadow: 0 16px 34px rgba(255, 153, 116, 0.24);
}

.button.ghost,
.main-tab,
.dashboard-tab,
.dashboard-ownership-tab,
.order-overview-ownership-tab,
.order-status-tab,
.slot-toggle button,
.calendar-window-button {
  color: rgba(255, 250, 240, 0.84);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
}

.button.ghost:hover,
.main-tab:hover,
.dashboard-tab:hover,
.dashboard-ownership-tab:hover,
.order-overview-ownership-tab:hover,
.order-status-tab:hover,
.calendar-window-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
}

.form-message.error {
  color: #ffb4a3;
}

.form-message.success {
  color: #b9f3e6;
}

.modal-overlay {
  background: rgba(7, 8, 10, 0.68);
  backdrop-filter: blur(14px);
}

.modal-card {
  border-radius: 24px;
}

.order-overview-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cell-status,
.status-badge,
.tag,
.stat-value {
  border-color: rgba(255, 255, 255, 0.13);
}

/* Unified dark console surfaces for order and statistics modules. */
.dashboard,
.order-overview,
.order-workbench {
  width: 100%;
  min-width: 0;
  color: var(--ink);
}

.dashboard,
.order-overview {
  display: grid;
  gap: 16px;
  padding: 20px 22px 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.dashboard-header,
.order-overview-header,
.order-workbench-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 0 0 4px;
}

.dashboard-title,
.order-overview-title,
.order-workbench-header h1 {
  margin: 0;
  color: var(--ink);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: clamp(1.7rem, 2.7vw, 2.35rem);
  font-weight: 800;
  letter-spacing: 0;
}

.order-workbench-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.dashboard-tabs,
.dashboard-ownership-tabs,
.order-overview-ownership-tabs,
.order-status-filter {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.dashboard-tab,
.dashboard-ownership-tab,
.order-overview-ownership-tab,
.order-status-tab {
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 999px;
  color: rgba(255, 250, 240, 0.82);
  background: transparent;
  border: 1px solid transparent;
  white-space: nowrap;
}

.dashboard-tab.active,
.dashboard-ownership-tab.active,
.order-overview-ownership-tab.active,
.order-status-tab.active {
  color: #201b0a;
  background: linear-gradient(135deg, #b9f3e6, #f6e66f 52%, #ff9974);
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(255, 153, 116, 0.22);
}

.dashboard-body,
.order-overview-body {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.dashboard-card,
.order-overview-stats,
.order-overview-table-wrap,
.order-stats-item {
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.dashboard-card {
  min-width: 0;
  padding: 16px;
  overflow: hidden;
}

.dashboard-card-title {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}

.chart-empty,
.chart-ranking,
.chart-donut-legend,
.chart-donut-label,
.chart-donut-value,
.chart-bar-label,
.chart-hbar-label,
.chart-hbar-value {
  color: var(--muted);
}

.chart-donut {
  background-color: rgba(255, 255, 255, 0.08);
}

.order-overview-stats {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
}

.order-overview-stats .stat-block {
  flex: 1 1 220px;
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.order-overview-stats .stat-divider {
  display: none;
}

.order-overview-stats .stat-label {
  color: var(--muted);
}

.order-overview-stats .stat-value,
.order-overview-stats .stat-value.owned,
.order-overview-stats .stat-value.partner {
  color: var(--ink);
}

.order-overview-search,
.order-overview-date-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  min-width: 0;
}

.order-overview-search input,
.date-filter-input {
  min-width: min(220px, 100%);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

.order-overview-search input {
  flex: 1 1 320px;
}

.date-filter-label,
.date-filter-sep {
  color: var(--muted);
}

.order-overview-table-wrap {
  overflow: auto;
  padding: 0;
}

.order-overview-table {
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
  background: transparent;
}

.order-overview-table thead {
  background: rgba(255, 255, 255, 0.11);
  border: 0;
}

.order-overview-table th,
.order-overview-table td {
  color: var(--ink) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.order-overview-table th {
  padding: 12px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  background: transparent;
}

.order-overview-table td {
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.035);
}

.order-overview-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.08);
}

.order-overview-table .cell-amount {
  color: var(--ink) !important;
  font-weight: 800;
}

.order-overview-table .cell-status,
.status-badge,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
  white-space: nowrap;
}

.order-overview-table .cell-status.active,
.order-overview-table .cell-status.return {
  color: #ffd7a8 !important;
  border-color: rgba(255, 153, 116, 0.3);
  background: rgba(255, 153, 116, 0.16);
}

.order-overview-table .cell-status.pending {
  color: #f6e66f !important;
  border-color: rgba(246, 230, 111, 0.3);
  background: rgba(246, 230, 111, 0.12);
}

.order-overview-table .cell-status.completed {
  color: #b9f3e6 !important;
  border-color: rgba(185, 243, 230, 0.32);
  background: rgba(185, 243, 230, 0.12);
}

.list-item,
.rental-record,
.calibration-item {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.list-item .muted,
.rental-record .muted,
.calibration-item .muted,
.item-meta,
.rental-meta,
.calibration-item-meta {
  color: var(--muted) !important;
}

.list-item h3,
.list-item strong,
.list-item .item-title,
.rental-record h3,
.rental-record strong,
.rental-record .rental-name,
.calibration-item h3,
.calibration-item strong {
  color: var(--ink);
}

@media (max-width: 900px) {
  .dashboard-header,
  .order-overview-header,
  .order-workbench-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-tabs,
  .dashboard-ownership-tabs,
  .order-overview-ownership-tabs,
  .order-status-filter {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-tab,
  .dashboard-ownership-tab,
  .order-overview-ownership-tab,
  .order-status-tab {
    flex: 1 1 auto;
  }
}

@media (max-width: 680px) {
  .web-account-bar,
  .hero,
  .panel,
  .summary-card,
  .order-overview,
  .modal-card {
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .web-account-bar,
  .hero,
  .panel,
  .summary-card,
  .taskboard,
  .order-workbench {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Final console layout guard: keep every business page on the same rail. */
.app {
  width: min(100%, 1240px);
  margin-inline: auto;
  padding-inline: clamp(18px, 3vw, 34px);
}

.tab-panel {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 20px;
  align-items: start;
}

.tab-panel[hidden] {
  display: none !important;
}

.tab-panel > *,
.taskboard,
.order-workbench,
.grid,
.hero,
.dashboard,
.order-overview {
  width: 100%;
  min-width: 0;
}

.web-account-bar,
.web-account-admin,
.main-tabs,
.taskboard,
.order-workbench,
.hero,
.dashboard,
.order-overview,
.grid {
  max-width: 100%;
  margin-inline: 0;
}

.order-workbench,
.tab-panel[data-panel="datacenter"] .hero,
.dashboard,
.order-overview {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 20px 22px 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.tab-panel[data-panel="datacenter"] .hero {
  grid-template-columns: minmax(220px, 0.62fr) minmax(0, 1.38fr);
  align-items: start;
  margin-bottom: 0;
}

.tab-panel[data-panel="datacenter"] .hero-text,
.tab-panel[data-panel="datacenter"] .hero-meta {
  width: 100%;
  min-width: 0;
  flex: initial;
}

.tab-panel[data-panel="datacenter"] .hero-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-workbench-header,
.dashboard-header,
.order-overview-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 0;
  margin: 0;
}

.order-workbench-header p,
.dashboard-card-title,
.order-overview-stats .stat-label,
.order-overview-empty,
.chart-empty,
.chart-ranking,
.chart-donut-legend,
.chart-donut-label,
.chart-bar-label,
.chart-hbar-label,
.task-item-meta,
.item-meta,
.rental-meta,
.calibration-item-meta,
.data-card-copy,
.data-card-tip {
  color: var(--muted) !important;
}

.order-workbench h1,
.dashboard-title,
.order-overview-title,
.summary-title,
.summary-value,
.task-item-title,
.item-title,
.device-code,
.rental-name,
.calibration-item strong {
  color: var(--ink) !important;
}

.order-overview-body,
.dashboard-body {
  overflow: visible;
}

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

.dashboard-card,
.summary-card,
.task-card,
.task-metric,
.order-overview-stats,
.order-overview-table-wrap,
.list-item,
.rental-record,
.calibration-item {
  color: var(--ink);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
}

.order-overview-stats,
.order-overview-search,
.order-overview-date-filter {
  width: 100%;
  min-width: 0;
}

.order-overview-search {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
}

.order-overview-date-filter {
  display: flex;
  flex-wrap: wrap;
}

.order-overview-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.order-overview-table {
  width: 100%;
}

.order-overview-table th,
.order-overview-table td {
  color: var(--ink) !important;
  background: transparent;
}

.order-overview-table td[style],
.order-overview-table th[style] {
  color: var(--ink) !important;
}

.order-overview-table td[data-label="微信"],
.order-overview-table td[data-label="设备"],
.order-overview-table td[data-label="渠道"],
.order-overview-table td[data-label="安心保"] {
  color: var(--muted) !important;
}

.account-select-menu {
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(35, 38, 40, 0.98), rgba(20, 22, 25, 0.98)),
    #17191c;
}

.account-select-option {
  color: rgba(255, 250, 240, 0.84);
}

.account-select-option:disabled {
  color: rgba(255, 250, 240, 0.42);
  background: transparent;
}

@media (max-width: 900px) {
  .order-workbench-header,
  .dashboard-header,
  .order-overview-header,
  .tab-panel[data-panel="datacenter"] .hero {
    grid-template-columns: 1fr;
  }

  .tab-panel[data-panel="datacenter"] .hero-meta,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .order-overview-search {
    grid-template-columns: 1fr;
  }
}

/* Final dark polish: remove legacy light blocks and oversized reminder/device cards. */
.app {
  width: min(100%, 1180px);
  padding-inline: clamp(14px, 2.4vw, 28px);
}

.reminder-panel {
  position: fixed;
  right: clamp(12px, 2vw, 22px);
  bottom: clamp(12px, 2vw, 22px);
  width: min(360px, calc(100vw - 24px));
  max-height: min(62vh, 560px);
  padding: 12px;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 18px;
  color: var(--ink) !important;
  background:
    linear-gradient(145deg, rgba(47, 49, 47, 0.94), rgba(20, 22, 21, 0.96)),
    #191b1a !important;
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  animation: none !important;
}

.reminder-panel.has-alert,
.reminder-panel.pulse-once {
  border-color: rgba(255, 180, 132, 0.36) !important;
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 180, 132, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  animation: none !important;
}

.reminder-header,
.reminder-group-header {
  min-height: 34px;
}

.reminder-title,
.reminder-group-title,
.reminder-item-title {
  color: var(--ink) !important;
  letter-spacing: 0;
}

.reminder-title {
  font-size: 0.92rem;
  font-weight: 800;
}

.reminder-title::before {
  background: linear-gradient(135deg, #d6f7d2, #ffd069, #ff9c6a);
  box-shadow: 0 0 0 5px rgba(255, 208, 105, 0.1);
}

.reminder-count,
.reminder-group-count {
  min-width: 22px;
  height: 22px;
  color: #2a2114 !important;
  background: linear-gradient(135deg, #d6f7d2, #ffe56f, #ff9c6a) !important;
  border: 0;
  box-shadow: 0 8px 18px rgba(255, 156, 106, 0.18);
}

.reminder-list,
.reminder-group {
  gap: 8px;
}

.reminder-group-header,
.reminder-group[data-type="start"] .reminder-group-header,
.reminder-group[data-type="end"] .reminder-group-header {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 13px;
  color: var(--ink) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.reminder-group-toggle {
  color: var(--muted) !important;
  font-size: 0.74rem;
  font-weight: 700;
}

.reminder-item,
.reminder-item.start,
.reminder-item.end {
  min-height: 0;
  padding: 11px 12px;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 14px;
  color: var(--ink) !important;
  background: rgba(255, 255, 255, 0.075) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.reminder-item::before {
  display: none;
}

.reminder-item-title {
  font-size: 0.9rem;
  line-height: 1.35;
}

.reminder-item-meta,
.reminder-item-range,
.reminder-item-person {
  color: var(--muted) !important;
  font-size: 0.78rem;
  line-height: 1.38;
}

.reminder-item-range {
  color: #ffd9a6 !important;
  font-weight: 800;
}

.reminder-item .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}

.reminder-item .button,
.reminder-batch-btn {
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.reminder-item .button.ghost,
.reminder-item.start .button.ghost,
.reminder-item.end .button.ghost {
  color: var(--ink) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.reminder-empty {
  color: var(--muted) !important;
}

#deviceList {
  display: grid;
  gap: 10px;
}

#deviceList .card,
.device-panel .card,
.device-panel .list-item {
  min-height: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 14px;
  color: var(--ink) !important;
  background: rgba(255, 255, 255, 0.075) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

#deviceList .card.rental-highlight,
.device-panel .card.rental-highlight {
  color: var(--ink) !important;
  background: rgba(255, 255, 255, 0.075) !important;
}

#deviceList .card.rental-highlight.highlight-pending,
#deviceList .card.rental-highlight.highlight-active,
#deviceList .card.rental-highlight.highlight-return,
.device-panel .card.rental-highlight.highlight-pending,
.device-panel .card.rental-highlight.highlight-active,
.device-panel .card.rental-highlight.highlight-return {
  box-shadow: inset 3px 0 0 rgba(255, 211, 103, 0.62) !important;
}

#deviceList .card.selected,
.device-panel .card.selected,
.device-panel .list-item.selected {
  border-color: rgba(255, 211, 103, 0.62) !important;
  color: var(--ink) !important;
  background:
    linear-gradient(135deg, rgba(255, 211, 103, 0.14), rgba(255, 255, 255, 0.07)) !important;
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.24),
    inset 0 0 0 1px rgba(255, 211, 103, 0.16) !important;
}

#deviceList .item-info,
#deviceList .device-title,
#deviceList .device-code,
#deviceList .item-title,
#deviceList strong,
.device-panel .item-info,
.device-panel .device-title,
.device-panel .device-code,
.device-panel .item-title,
.device-panel strong {
  color: var(--ink) !important;
}

#deviceList .device-meta,
#deviceList .item-meta,
#deviceList .muted,
.device-panel .device-meta,
.device-panel .item-meta,
.device-panel .muted {
  color: var(--muted) !important;
}

#deviceList .actions,
.device-panel .card .actions,
.device-panel .list-item .actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

#deviceList .button,
.device-panel .card .button,
.device-panel .list-item .button {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
}

#deviceList .button.ghost,
.device-panel .button.ghost {
  color: var(--ink) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

#deviceList .button.danger,
.device-panel .button.danger {
  color: #ffb0a2 !important;
  border-color: rgba(255, 105, 105, 0.28) !important;
  background: rgba(255, 105, 105, 0.13) !important;
}

.ownership-badge,
.device-type-badge,
.device-status-badge,
.status-badge {
  color: #173229 !important;
}

.device-panel,
.mobile-device-trigger,
.chart-card,
.dashboard-card {
  color: var(--ink) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.055)) !important;
  box-shadow: var(--shadow);
}

.dashboard-card-title,
.chart-bar-label,
.chart-hbar-label,
.chart-donut-label,
.chart-donut-legend,
.chart-ranking,
.order-overview-stats,
.order-overview-stats *,
.data-card-copy,
.data-card-tip {
  color: var(--muted) !important;
}

.chart-bar-value,
.chart-hbar-value,
.dashboard-card strong,
.order-overview-stats strong {
  color: var(--ink) !important;
}

.chart-hbar-track {
  background: rgba(255, 255, 255, 0.07) !important;
}

.chart-ranking-item,
.order-stats-list,
.order-stats-item {
  color: var(--ink) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.07) !important;
}

.tab-panel[data-panel="datacenter"] .hero {
  color: var(--ink) !important;
}

.tab-panel[data-panel="datacenter"] .hero h1 {
  color: var(--ink) !important;
}

.tab-panel[data-panel="datacenter"] .subtitle,
.tab-panel[data-panel="datacenter"] .eyebrow {
  color: var(--muted) !important;
}

.tab-panel[data-panel="datacenter"] .summary-card,
.tab-panel[data-panel="datacenter"] .summary-group,
.tab-panel[data-panel="datacenter"] .count-card {
  color: var(--ink) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.055)) !important;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.07) !important;
}

.tab-panel[data-panel="datacenter"] .summary-card {
  padding: 14px;
  border-radius: 18px;
}

.tab-panel[data-panel="datacenter"] .summary-split {
  display: grid;
  gap: 12px;
}

.tab-panel[data-panel="datacenter"] .summary-group {
  padding: 12px;
  border-radius: 14px;
}

.tab-panel[data-panel="datacenter"] .summary-title {
  display: block;
  margin-bottom: 12px;
  color: var(--ink) !important;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
}

.tab-panel[data-panel="datacenter"] .summary-subtitle {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #16392f !important;
  background: rgba(185, 243, 230, 0.78) !important;
  font-size: 0.78rem;
  font-weight: 800;
}

.tab-panel[data-panel="datacenter"] .summary-row,
.tab-panel[data-panel="datacenter"] .summary-action-row {
  min-height: 30px;
  padding: 0;
  color: var(--ink) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.tab-panel[data-panel="datacenter"] .summary-action-row {
  width: 100%;
  cursor: pointer;
}

.tab-panel[data-panel="datacenter"] .summary-action-row:hover {
  color: var(--ink) !important;
  transform: none;
}

.tab-panel[data-panel="datacenter"] .summary-label {
  color: rgba(255, 250, 240, 0.68) !important;
  font-size: 0.84rem;
  font-weight: 700;
}

.tab-panel[data-panel="datacenter"] .summary-value {
  color: var(--ink) !important;
  font-size: 1rem;
  font-weight: 900;
  text-shadow: none;
}

.tab-panel[data-panel="rental"] .rental-panel {
  width: 100%;
  min-width: 0;
  color: var(--ink) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.055)) !important;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tab-panel[data-panel="rental"] .rental-panel .panel-header h2,
.tab-panel[data-panel="rental"] .availability-query h3,
.tab-panel[data-panel="rental"] .list-header h3 {
  color: var(--ink) !important;
}

.tab-panel[data-panel="rental"] .rental-panel .muted,
.tab-panel[data-panel="rental"] #rentalListMeta,
.tab-panel[data-panel="rental"] .availability-query-copy p,
.tab-panel[data-panel="rental"] .availability-order-search-copy p {
  color: var(--muted) !important;
}

.tab-panel[data-panel="rental"] .availability-query,
.tab-panel[data-panel="rental"] .availability-order-search {
  color: var(--ink) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@media (max-width: 680px) {
  .mobile-bottom-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    background:
      linear-gradient(135deg, rgba(38, 40, 39, 0.96), rgba(18, 20, 19, 0.96)) !important;
    box-shadow:
      0 16px 36px rgba(0, 0, 0, 0.36),
      inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  }

  .mobile-nav-item {
    color: var(--muted) !important;
    font-size: 0.68rem;
  }

  .mobile-nav-item.active {
    color: #221b0b !important;
    background: linear-gradient(135deg, #d6f7d2, #ffe56f, #ff9c6a) !important;
  }
}

.tab-panel,
.panel,
.hero,
.dashboard,
.order-workbench,
.order-overview,
.taskboard,
.summary-card,
.dashboard-card,
.task-card,
.task-metric,
.rental-record,
.calibration-item {
  color: var(--ink);
}
