/* ============================================================
   RentHub · 深色现代租赁台账
   移动优先；窄屏列表卡片化，宽屏表格化
   ============================================================ */

:root {
  --bg: #070b14;
  --bg-soft: #0b1220;
  --panel: rgba(18, 28, 48, 0.86);
  --panel-solid: #111a2d;
  --panel-hover: rgba(30, 44, 72, 0.9);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.26);
  --text: #e8eef9;
  --text-soft: #c2ccdd;
  --muted: #8a9ab3;
  --cyan: #22d3ee;
  --indigo: #6366f1;
  --cyan-dim: rgba(34, 211, 238, 0.14);
  --indigo-dim: rgba(99, 102, 241, 0.16);
  --red: #fb7185;
  --red-dim: rgba(251, 113, 133, 0.13);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.14);
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.13);
  --slate: #94a3b8;
  --slate-dim: rgba(148, 163, 184, 0.13);
  --gradient: linear-gradient(135deg, #22d3ee 0%, #6366f1 100%);
  --gradient-soft: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(99, 102, 241, 0.18));
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 18px 48px rgba(1, 6, 18, 0.5);
  --shadow-soft: 0 8px 24px rgba(1, 6, 18, 0.32);
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html { -webkit-text-size-adjust: 100%; }

body {
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  background:
    radial-gradient(1100px 560px at 88% -12%, rgba(99, 102, 241, 0.18), transparent 62%),
    radial-gradient(820px 500px at -8% 4%, rgba(34, 211, 238, 0.12), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }

.hidden { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-cyan { color: var(--cyan); }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.14s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  color: #04121a;
  background: var(--gradient);
  box-shadow: 0 8px 22px rgba(34, 211, 238, 0.22), 0 2px 8px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(34, 211, 238, 0.32), 0 4px 12px rgba(99, 102, 241, 0.3); }

.btn-secondary {
  color: var(--text);
  background: rgba(148, 163, 184, 0.1);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: rgba(148, 163, 184, 0.17); }

.btn-ghost {
  color: var(--text-soft);
  background: transparent;
  border-color: var(--border);
}
.btn-ghost:hover { background: rgba(148, 163, 184, 0.08); }

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #fb7185, #e11d48);
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.22);
}
.btn-danger-soft {
  color: var(--red);
  background: var(--red-dim);
  border-color: rgba(251, 113, 133, 0.32);
}
.btn-danger-soft:hover { background: rgba(251, 113, 133, 0.2); }

.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.06);
  color: var(--text-soft);
  font-size: 17px;
  transition: background 0.16s ease, color 0.16s ease;
}
.icon-btn:hover { background: rgba(148, 163, 184, 0.14); color: var(--text); }

.ghost-btn {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.ghost-btn:hover { color: var(--text); border-color: var(--border-strong); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 600;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- 登录页 ---------- */
.login-view {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
  overflow: hidden;
}
.login-glow {
  position: absolute;
  inset: -20% -10%;
  background:
    radial-gradient(420px 420px at 68% 22%, rgba(34, 211, 238, 0.18), transparent 65%),
    radial-gradient(520px 520px at 24% 78%, rgba(99, 102, 241, 0.22), transparent 65%);
  pointer-events: none;
}
.login-card {
  position: relative;
  width: min(390px, 100%);
  padding: 38px 28px 26px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(22, 33, 56, 0.92), rgba(11, 18, 32, 0.94));
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  text-align: center;
}
.login-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.login-card h1 { margin: 0; font-size: 24px; letter-spacing: 0.02em; }
.login-sub { margin: 6px 0 26px; color: var(--muted); font-size: 14px; }
.login-card form { text-align: left; }
.login-foot { margin: 22px 0 0; color: #66758e; font-size: 12px; }

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--gradient);
  color: #03121b;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.28);
}
.logo-mark.small {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 17px;
  box-shadow: 0 6px 16px rgba(34, 211, 238, 0.24);
}

/* ---------- 应用框架 ---------- */
.app-view { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 62px;
  padding: 0 18px;
  background: rgba(7, 11, 20, 0.78);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-width: 0;
}
.brand > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 44vw;
}
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ---------- 设置菜单 ---------- */
.settings-wrap { position: relative; }
.settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 158px;
  padding: 6px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, #17233b, #0c1425);
  box-shadow: var(--shadow);
}
.settings-menu button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-size: 13.5px;
  text-align: left;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.settings-menu button:hover { background: rgba(34, 211, 238, 0.11); color: var(--text); }

.top-nav { display: none; gap: 4px; margin-left: 10px; }
.top-nav a {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}
.top-nav a:hover { color: var(--text); background: rgba(148, 163, 184, 0.08); }
.top-nav a.active {
  color: var(--cyan);
  background: var(--cyan-dim);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.22);
}

.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px auto 0;
  width: min(1180px, calc(100% - 32px));
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--amber-dim);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fde68a;
  font-size: 13px;
}
.banner code { font-family: var(--mono); color: var(--amber); }

.main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 20px 16px 104px;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(9, 15, 27, 0.94);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 2px;
  border-radius: 10px;
  color: #73839c;
  font-size: 11px;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}
.tab-ico { font-size: 16px; line-height: 1; }
.tabbar a.active { color: var(--cyan); background: rgba(34, 211, 238, 0.08); }

/* ---------- 页面标题 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 4px 0 18px;
}
.page-head h1 {
  margin: 0;
  font-size: 23px;
  letter-spacing: 0.01em;
}
.page-head .sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.card {
  background: linear-gradient(180deg, rgba(22, 33, 56, 0.76), rgba(12, 19, 34, 0.82));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
}
.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.card-title .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: 1px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.card-title.danger .dot { background: var(--red); box-shadow: 0 0 10px var(--red); }
.card-title.warn .dot { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.card-body { padding: 8px 18px 18px; }
.card-body.flush { padding: 0; }
.card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

.empty {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty .empty-ico { display: block; font-size: 26px; margin-bottom: 8px; opacity: 0.6; }

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.kpi-card {
  position: relative;
  padding: 17px 16px 15px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(26, 38, 63, 0.82), rgba(12, 19, 34, 0.9));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: var(--gradient);
  opacity: 0.75;
}
.kpi-card.danger::before { background: linear-gradient(90deg, #fb7185, #f97316); }
.kpi-card.amber::before { background: linear-gradient(90deg, #fbbf24, #f97316); }
.kpi-card.green::before { background: linear-gradient(90deg, #34d399, #22d3ee); }
.kpi-label { color: var(--muted); font-size: 12px; letter-spacing: 0.03em; }
.kpi-value {
  margin-top: 7px;
  font-family: var(--mono);
  font-size: clamp(23px, 5.4vw, 31px);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi-value .unit { margin-left: 3px; font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi-meta { margin-top: 4px; color: #6f809a; font-size: 11.5px; }
.kpi-card.danger .kpi-value { color: var(--red); }
.kpi-card.green .kpi-value { color: var(--green); }
.kpi-card.amber .kpi-value { color: var(--amber); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 7px currentColor;
}
.badge.out { color: var(--cyan); background: var(--cyan-dim); border-color: rgba(34, 211, 238, 0.3); }
.badge.overdue { color: var(--red); background: var(--red-dim); border-color: rgba(251, 113, 133, 0.32); }
.badge.returned { color: #8fb8a8; background: rgba(143, 184, 168, 0.12); border-color: rgba(143, 184, 168, 0.26); }
.badge.booked { color: var(--amber); background: var(--amber-dim); border-color: rgba(251, 191, 36, 0.3); }
.badge.cancelled { color: var(--slate); background: var(--slate-dim); border-color: rgba(148, 163, 184, 0.24); }
.badge.available { color: var(--green); background: var(--green-dim); border-color: rgba(52, 211, 153, 0.26); }
.badge.repair { color: var(--amber); background: var(--amber-dim); border-color: rgba(251, 191, 36, 0.28); }
.badge.lost, .badge.retired { color: var(--slate); background: var(--slate-dim); border-color: rgba(148, 163, 184, 0.24); }
.badge.blacklist { color: var(--red); background: var(--red-dim); border-color: rgba(251, 113, 133, 0.32); }
.badge.sm { padding: 1px 7px; font-size: 10.5px; }
.badge.sm::before { width: 5px; height: 5px; }

/* ---------- 工具栏 / 筛选 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search-box { position: relative; flex: 1 1 190px; min-width: 0; }
.search-box input { padding-left: 36px; }
.search-box .search-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #6d7e99;
  font-size: 14px;
  pointer-events: none;
}
.select-compact {
  min-height: 42px;
  padding: 0 34px 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(148, 163, 184, 0.07);
  color: var(--text-soft);
  font-size: 13.5px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8a9ab3 50%),
    linear-gradient(135deg, #8a9ab3 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.select-compact:focus { outline: none; border-color: rgba(34, 211, 238, 0.55); }

/* 品类 chip 筛选组 */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  width: 100%;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(148, 163, 184, 0.07);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.12s ease, box-shadow 0.15s ease;
}
.filter-chip:hover { color: var(--text-soft); border-color: rgba(34, 211, 238, 0.4); }
.filter-chip:active { transform: scale(0.96); }
.filter-chip.active {
  color: #04121a;
  font-weight: 700;
  background: var(--gradient);
  border-color: rgba(34, 211, 238, 0.78);
  box-shadow: 0 6px 16px rgba(34, 211, 238, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.filter-chip.active .chip-tag { background: rgba(4, 18, 26, 0.18); color: #04121a; }

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 13px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.tab:hover { color: var(--text-soft); }
.tab.active {
  color: var(--text);
  background: rgba(34, 211, 238, 0.14);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.24);
}

/* ---------- 行卡片列表 ---------- */
.row-list { display: flex; flex-direction: column; gap: 10px; }
.row-card {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px 17px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(24, 36, 60, 0.7), rgba(13, 21, 37, 0.8));
  box-shadow: 0 6px 18px rgba(1, 6, 18, 0.22);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.row-card:hover {
  border-color: rgba(34, 211, 238, 0.28);
  background: linear-gradient(180deg, rgba(29, 43, 71, 0.78), rgba(15, 24, 42, 0.86));
}
.row-card:active { transform: scale(0.995); }
.row-main { min-width: 0; }
.row-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.row-title .mono { font-size: 13.5px; color: var(--cyan); }
.row-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-meta { display: flex; flex-direction: column; gap: 2px; color: var(--text-soft); font-size: 12.5px; min-width: 0; }
.row-meta .muted { font-size: 11.5px; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; }
.row-amount { font-family: var(--mono); font-size: 15px; font-weight: 700; }
.row-amount small { font-size: 11px; color: var(--muted); font-weight: 500; }

.device-row {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.05fr) auto;
}
.deposit-line { color: var(--muted); font-size: 11.5px; }
.item-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

/* ---------- 表单 ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { color: var(--text-soft); font-size: 12.5px; font-weight: 550; }
.field label .req { color: var(--red); margin-left: 2px; }
.field .hint { color: #6f809a; font-size: 11.5px; line-height: 1.45; }
.field input,
.field select,
.field textarea,
.input {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: rgba(6, 11, 21, 0.55);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.field textarea { min-height: 82px; resize: vertical; line-height: 1.5; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8a9ab3 50%),
    linear-gradient(135deg, #8a9ab3 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.field input::placeholder, .field textarea::placeholder { color: #56657d; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
  background: rgba(6, 11, 21, 0.72);
}
.field input[type="date"] { color-scheme: dark; }
.field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: #22d3ee;
}
.check-line {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 2px;
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
}
.check-line input { flex: 0 0 auto; }

.form-error {
  margin: 2px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--red-dim);
  border: 1px solid rgba(251, 113, 133, 0.3);
  color: #fecdd3;
  font-size: 12.5px;
  line-height: 1.5;
}
.form-note {
  padding: 11px 13px;
  border-radius: 11px;
  background: rgba(34, 211, 238, 0.07);
  border: 1px solid rgba(34, 211, 238, 0.16);
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.55;
}
.form-note.warn {
  background: var(--amber-dim);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

/* ---------- 品类 chip 选择器 ---------- */
.chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.035);
}
.picker-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.12s ease, box-shadow 0.15s ease;
}
.picker-chip:hover { border-color: rgba(34, 211, 238, 0.45); color: var(--text); }
.picker-chip:active { transform: scale(0.96); }
.picker-chip.selected {
  color: #04121a;
  font-weight: 700;
  background: var(--gradient);
  border-color: rgba(34, 211, 238, 0.8);
  box-shadow: 0 8px 20px rgba(34, 211, 238, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.picker-add {
  border-style: dashed;
  border-color: rgba(34, 211, 238, 0.4);
  background: transparent;
  color: var(--cyan);
}
.picker-add:hover { background: rgba(34, 211, 238, 0.09); }
.chip-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--amber-dim);
  color: var(--amber);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
}
.picker-chip.selected .chip-tag { background: rgba(4, 18, 26, 0.18); color: #04121a; }
.chip-new {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chip-new .input { flex: 1 1 auto; min-width: 0; }
.chip-new .btn { flex: 0 0 auto; }

/* ---------- 品类管理 ---------- */
.cat-intro {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}
.cat-list { display: flex; flex-direction: column; gap: 9px; }
.cat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.045);
}
.cat-info { min-width: 0; }
.cat-name-input { min-height: 38px !important; font-weight: 600; }
.cat-meta { margin-top: 5px; color: var(--muted); font-size: 11.5px; }
.cat-hint { margin-top: 3px; color: #8a7a52; font-size: 11px; line-height: 1.5; }
.cat-state { display: flex; align-items: center; gap: 8px; }
.cat-state-text { color: var(--muted); font-size: 11.5px; min-width: 26px; }
.cat-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cat-move { width: 34px; height: 34px; font-size: 14px; border-radius: 9px; }
.cat-move:disabled, .cat-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.cat-add-row {
  display: flex;
  gap: 9px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.cat-add-row .input { flex: 1 1 auto; min-width: 0; }
.cat-add-row .btn { flex: 0 0 auto; }

/* 启用/停用开关 */
.switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  cursor: pointer;
}
.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(148, 163, 184, 0.18);
  transition: background 0.16s ease, border-color 0.16s ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: transform 0.16s ease, background 0.16s ease;
}
.switch input:checked + .switch-track {
  background: var(--gradient);
  border-color: rgba(34, 211, 238, 0.6);
}
.switch input:checked + .switch-track::after {
  transform: translateX(18px);
  background: #04121a;
}
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18); }

/* ---------- 订单创建页 ---------- */
.form-section { padding: 18px; }
.form-section + .form-section { border-top: 1px solid var(--border); }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.section-head .step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 7px;
  background: var(--cyan-dim);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}
.availability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 10px;
}
.device-pick {
  position: relative;
  display: block;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.045);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.device-pick:hover { border-color: var(--border-strong); background: rgba(148, 163, 184, 0.08); }
.device-pick.selected {
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.1);
}
.device-pick.disabled { cursor: not-allowed; opacity: 0.6; }
.device-pick.disabled:hover { border-color: var(--border); background: rgba(148, 163, 184, 0.045); }
.device-pick input { position: absolute; opacity: 0; pointer-events: none; }
.dp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dp-code { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--text); }
.dp-model {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dp-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.dp-price { font-family: var(--mono); color: var(--text-soft); }
.dp-reason { margin-top: 7px; color: var(--amber); font-size: 11px; line-height: 1.4; }

.picked-list { display: flex; flex-direction: column; gap: 8px; }
.picked-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 94px 104px 90px 32px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.055);
  border: 1px solid var(--border);
}
.picked-name { min-width: 0; }
.picked-name .code { font-family: var(--mono); font-size: 13px; font-weight: 650; }
.picked-name .sub { color: var(--muted); font-size: 11px; }
.picked-row input {
  width: 100%;
  min-height: 36px;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(6, 11, 21, 0.6);
  font-size: 13px;
  font-family: var(--mono);
}
.picked-row input:focus { outline: none; border-color: rgba(34, 211, 238, 0.55); }
.picked-label { display: block; color: var(--muted); font-size: 10.5px; margin-bottom: 3px; }
.picked-subtotal { font-family: var(--mono); font-size: 13px; text-align: right; }
.remove-x {
  width: 30px; height: 30px;
  border: none; border-radius: 8px;
  background: rgba(251, 113, 133, 0.1);
  color: var(--red);
  font-size: 15px;
  line-height: 1;
}
.remove-x:hover { background: rgba(251, 113, 133, 0.2); }

.total-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
}
.total-item { text-align: right; }
.total-item .label { color: var(--muted); font-size: 11.5px; }
.total-item .value { font-family: var(--mono); font-size: 17px; font-weight: 700; }
.total-item .value.big {
  font-size: 22px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  background: rgba(6, 11, 21, 0.25);
}

/* ---------- 详情页 ---------- */
.detail-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(19px, 4vw, 24px);
  letter-spacing: 0.01em;
}
.detail-sub { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.info-cell {
  padding: 12px 14px;
  background: rgba(13, 21, 37, 0.94);
  min-width: 0;
}
.info-cell .k { color: var(--muted); font-size: 11.5px; }
.info-cell .v { margin-top: 3px; font-size: 13.5px; word-break: break-word; }
.info-cell .v.mono { font-family: var(--mono); font-size: 14px; }
.info-cell.full { grid-column: 1 / -1; }

.item-list { display: flex; flex-direction: column; gap: 8px; }
.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) repeat(3, minmax(0, 0.7fr)) minmax(0, 0.8fr);
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--border);
}
.item-row .item-code { font-family: var(--mono); font-size: 13px; font-weight: 650; }
.item-row .item-model { color: var(--muted); font-size: 11.5px; }
.item-kv { text-align: right; }
.item-kv .k { display: block; color: var(--muted); font-size: 10.5px; }
.item-kv .v { font-family: var(--mono); font-size: 13px; }
.item-check { text-align: right; }

.return-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border);
}
.return-summary .rs-label { color: var(--muted); font-size: 12px; }
.return-summary .rs-value { font-family: var(--mono); font-size: 20px; font-weight: 700; }

.verify-item {
  padding: 12px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.045);
}
.verify-item + .verify-item { margin-top: 8px; }
.verify-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.verify-code { font-family: var(--mono); font-size: 13px; font-weight: 650; }
.radio-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill span {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.05);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.radio-pill input:checked + span {
  color: var(--cyan);
  background: var(--cyan-dim);
  border-color: rgba(34, 211, 238, 0.42);
}
.radio-pill input:checked + span.dmg { color: var(--red); background: var(--red-dim); border-color: rgba(251, 113, 133, 0.4); }
.radio-pill input:checked + span.miss { color: var(--amber); background: var(--amber-dim); border-color: rgba(251, 191, 36, 0.4); }

/* ---------- 设备详情抽屉 ---------- */
.drawer-panel .modal-body { padding-top: 4px; }
.drawer-section + .drawer-section { margin-top: 20px; }
.drawer-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.045);
  cursor: pointer;
}
.history-item + .history-item { margin-top: 7px; }
.history-item:hover { border-color: rgba(34, 211, 238, 0.3); }
.history-main { min-width: 0; }
.history-main .h-top { font-size: 13px; font-weight: 600; }
.history-main .h-sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.accessory-text { white-space: pre-wrap; color: var(--text-soft); font-size: 13px; line-height: 1.6; }

/* ---------- 模态框 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(3, 7, 15, 0.66);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.16s ease;
}
.modal-overlay.show { opacity: 1; }
.modal {
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #17233b, #0c1425);
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(14px);
  transition: transform 0.18s ease;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal.wide { max-width: 760px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 16.5px; font-weight: 650; }
.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(6, 11, 21, 0.32);
}
.modal-foot .btn { min-width: 94px; }

@media (min-width: 761px) {
  .modal-overlay { align-items: center; padding: 24px; }
  .modal { border-radius: 18px; border-bottom: 1px solid var(--border-strong); box-shadow: var(--shadow); }
  .modal.drawer-panel {
    margin-left: auto;
    max-width: 520px;
    height: calc(100vh - 48px);
    max-height: calc(100vh - 48px);
    border-radius: 18px;
  }
}

/* ---------- Toast ---------- */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(420px, calc(100% - 28px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(20, 31, 52, 0.97);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  animation: toast-in 0.2s ease;
}
.toast .t-ico { flex: 0 0 auto; line-height: 1.35; }
.toast.success { border-color: rgba(52, 211, 153, 0.4); }
.toast.success .t-ico { color: var(--green); }
.toast.error { border-color: rgba(251, 113, 133, 0.45); }
.toast.error .t-ico { color: var(--red); }
.toast.info .t-ico { color: var(--cyan); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: all 0.18s ease; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 日历 ---------- */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cal-range { display: flex; align-items: center; gap: 10px; }
.cal-range .range-text { font-family: var(--mono); font-size: 14px; font-weight: 650; }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 11.5px; }
.legend-dot { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot i {
  width: 9px; height: 9px; border-radius: 3px; display: inline-block;
  background: var(--cyan-dim); border: 1px solid rgba(34, 211, 238, 0.45);
}
.legend-dot i.amber { background: var(--amber-dim); border-color: rgba(251, 191, 36, 0.45); }
.legend-dot i.red { background: var(--red-dim); border-color: rgba(251, 113, 133, 0.45); }
.legend-dot i.free { background: rgba(148, 163, 184, 0.06); border-color: var(--border); }

.cal-scroll { overflow: hidden; }
.cal-grid {
  display: grid;
  grid-template-columns: 74px repeat(7, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}
.cal-head {
  padding: 6px 2px;
  text-align: center;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}
.cal-head.today { color: var(--cyan); }
.cal-head .wd { display: block; font-size: 10px; }
.cal-head .d { display: block; font-family: var(--mono); font-size: 11.5px; font-weight: 650; }
.cal-device {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 5px;
  min-width: 0;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.045);
}
.cal-device .code {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 650;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-device .cat {
  color: var(--muted);
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  min-width: 0;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.07);
  background: rgba(148, 163, 184, 0.035);
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cal-cell.today { border-color: rgba(34, 211, 238, 0.3); background: rgba(34, 211, 238, 0.05); }
.cal-cell.occupied {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 650;
  background: rgba(34, 211, 238, 0.13);
  border-color: rgba(34, 211, 238, 0.34);
}
.cal-cell.occupied:hover { background: rgba(34, 211, 238, 0.2); }
.cal-cell.occupied.booked { color: var(--amber); background: var(--amber-dim); border-color: rgba(251, 191, 36, 0.32); }
.cal-cell.occupied.overdue { color: var(--red); background: var(--red-dim); border-color: rgba(251, 113, 133, 0.4); }
.cal-cell.occupied.returned { color: var(--slate); background: var(--slate-dim); border-color: var(--border); }
.cal-cell .initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(3, 10, 20, 0.35);
  font-size: 11px;
}

/* ---------- 其他 ---------- */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.stack-14 { display: flex; flex-direction: column; gap: 14px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.loading-text { padding: 40px 0; text-align: center; color: var(--muted); font-size: 13px; }
.mini-note { color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.page-foot-note { margin-top: 18px; color: #62728b; font-size: 11.5px; text-align: center; }

/* ---------- 响应式 ---------- */
@media (min-width: 620px) {
  .kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 761px) {
  .grid-2 { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
  .row-card { padding: 17px 20px; }
  .main { padding-bottom: 48px; }
}

@media (min-width: 901px) {
  .top-nav { display: flex; }
  .tabbar { display: none; }
  .main { padding: 28px 22px 56px; }
  .topbar { padding: 0 28px; }
  .page-head h1 { font-size: 26px; }
  .card-head { padding: 18px 22px 10px; }
  .card-body { padding: 8px 22px 22px; }
  .form-section { padding: 22px; }
  .detail-title h1 { font-size: 25px; }
}

@media (max-width: 760px) {
  .row-card, .device-row { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .row-side { flex-direction: row; align-items: center; justify-content: space-between; text-align: left; width: 100%; }
  .row-sub { white-space: normal; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .cat-row { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 10px; }
  .cat-actions { justify-content: flex-start; }
  .chip-new { flex-wrap: wrap; }
  .picked-row { grid-template-columns: minmax(0, 1fr) 78px 88px 30px; }
  .picked-subtotal { grid-column: 1 / -1; text-align: right; font-size: 12px; color: var(--muted); }
  .item-row { grid-template-columns: minmax(0, 1fr) minmax(0, 0.65fr) minmax(0, 0.65fr); }
  .item-row .item-kv.days-kv { display: none; }
  .item-row .item-check { grid-column: 1 / -1; text-align: left; }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1 1 auto; }
  .total-bar { justify-content: space-between; gap: 14px; }
  .total-item { text-align: left; }
  .availability-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .cal-grid { grid-template-columns: 62px repeat(7, minmax(0, 1fr)); gap: 3px; }
  .cal-cell { min-height: 38px; font-size: 10px; }
  .cal-device .code { font-size: 9.5px; }
  .cal-device .cat { display: none; }
  .cal-head .wd { font-size: 9px; }
  .cal-head .d { font-size: 10px; }
  .modal-body { padding: 16px; }
  .modal-head { padding: 15px 16px 11px; }
  .modal-foot { padding: 13px 16px calc(13px + env(safe-area-inset-bottom)); }
}

@media (max-width: 619px) {
  .dashboard-kpis .kpi-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .kpi-grid { gap: 9px; }
  .kpi-card { padding: 14px 13px 12px; }
  .kpi-value { font-size: 23px; }
  .main { padding-left: 12px; padding-right: 12px; }
  .picked-row { grid-template-columns: minmax(0, 1fr) 72px 30px; }
  .picked-row .deposit-cell { grid-column: 1 / 2; }
  .picked-row .subtotal-cell { grid-column: 2 / 3; text-align: right; }
  .picked-row .remove-cell { grid-column: 3 / 4; }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
  .cal-grid { grid-template-columns: 54px repeat(7, minmax(0, 1fr)); }
  .cal-cell { min-height: 36px; border-radius: 6px; }
  .modal { max-height: 94vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
