:root {
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #111827;
  --muted: #4B5563;
  --placeholder: #9CA3AF;
  --label: #374151;
  --line: #E5E7EB;
  --accent: #059669;
  --accent2: #047857;
  --accent-soft: #10B981;
  --danger: #B91C1C;
  --ok: #047857;
  --warn: #C2410C;
  --add-bg: #ECFDF5;
  --add-bd: #A7F3D0;
  --del-bg: #FEF2F2;
  --del-bd: #FECACA;
  --chg-bg: #FFFBEB;
  --chg-bd: #FDE68A;
  --hover-bg: #ECFDF5;
  --hover-bg-soft: #F9FAFB;
  --hover-line: #6EE7B7;
  --focus-ring: 0 0 0 3px rgba(16, 185, 129, 0.25);
  --radius: 6px;
  --radius-lg: 10px;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
  --ease: 0.15s ease;
  --control-h: 38px;
  --control-h-sm: 32px;
  --field-w-sm: 7.5rem;
  --field-w-md: 10rem;
  --field-w-lg: 14rem;
  /* Shared <dialog> chrome */
  --dlg-backdrop: rgba(15, 23, 42, 0.45);
  --dlg-backdrop-deep: rgba(2, 6, 23, 0.88);
  --dlg-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
  --dlg-radius: var(--radius-lg);
  --dlg-pad: 20px 20px 16px;
  --dlg-title-size: 16px;
  --dlg-title-weight: 650;
  /* 编辑 / 结项 / 阻塞：同一工作流弹窗宽度（双栏结项略宽） */
  --admin-workflow-dlg-w: min(1000px, 96vw);
  /* Sticky app/admin topbar clearance for in-page hash jumps */
  --app-topbar-h: 56px;
  --scroll-pad-top: calc(var(--app-topbar-h) + 12px);
}

* { box-sizing: border-box; }

html {
  scroll-padding-top: var(--scroll-pad-top);
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--accent2); text-decoration: underline; }
a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; }

/* ?? Front app shell (Slate + Emerald) ?? */
.app-body {
  --app-top: #1E293B;
  --app-top-2: #0F172A;
  --app-active: rgba(16, 185, 129, 0.18);
  --app-active-ink: #ECFDF5;
  --app-muted: #94A3B8;
  --app-surface: #F8FAFC;
  background: var(--app-surface);
  min-height: 100vh;
}
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--app-top);
  border-bottom: 1px solid rgba(15, 23, 42, 0.4);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.app-topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 24px;
  width: 100%;
  box-sizing: border-box;
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
  color: #F1F5F9;
}
.app-brand:hover { text-decoration: none; color: #fff; }
.app-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(145deg, var(--accent-soft), var(--accent));
  box-shadow: none;
}
.app-brand-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}
.app-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.app-nav a,
.app-nav-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 0;
  background: transparent;
  color: #94A3B8;
  font-family: inherit;
  font-size: 13.5px;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.app-nav a:hover,
.app-nav-drop-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #F8FAFC;
  text-decoration: none;
}
.app-nav a.active,
.app-nav-drop-btn.active,
.app-nav-drop.is-active > .app-nav-drop-btn {
  background: var(--app-active);
  color: var(--app-active-ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent-soft);
}
.app-nav a.active:hover,
.app-nav-drop-btn.active:hover {
  background: var(--app-active);
  color: var(--app-active-ink);
}
.app-nav-ico,
.app-nav svg.app-nav-ico {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex: 0 0 16px;
  display: block;
  opacity: 0.92;
}
.app-nav-caret {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  opacity: 0.7;
  transition: transform 0.15s ease;
}
.app-nav-drop {
  position: relative;
  flex: 0 0 auto;
}
.app-nav-drop.is-open > .app-nav-drop-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
}
.app-nav-drop.is-open .app-nav-caret {
  transform: rotate(180deg);
}
.app-nav-drop-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 90;
  min-width: 168px;
  padding: 6px;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}
.app-nav-drop-panel[hidden] {
  display: none !important;
}
.app-nav-drop-panel a {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  color: #334155;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: none !important;
  background: transparent !important;
}
.app-nav-drop-panel a svg.btn-ico,
.app-nav-drop-panel a svg.app-nav-ico {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex: 0 0 16px;
  opacity: 0.85;
}
.app-nav-drop-panel a:hover {
  background: #f1f5f9 !important;
  color: #0f172a;
  text-decoration: none;
}
.app-nav-drop-panel a.active {
  background: #ecfdf5 !important;
  color: #047857;
  font-weight: 600;
}
.app-nav-drop-panel--wide {
  min-width: 196px;
}
.app-nav-drop-label {
  margin: 8px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.app-nav-drop-label:first-child {
  margin-top: 2px;
}
.app-nav-drop-sep {
  height: 1px;
  margin: 6px 8px;
  background: #e2e8f0;
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 999px;
  background: #f59e0b;
  color: #1f2937;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.app-nav-drawer-nav a .nav-badge {
  margin-left: 8px;
}
.app-nav-toggle {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  margin: 0;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #F1F5F9;
  cursor: pointer;
  flex: 0 0 auto;
}
.app-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}
.app-nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 23, 42, 0.45);
}
.app-nav-scrim[hidden] {
  display: none !important;
}
.app-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  width: min(300px, 86vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0F172A;
  color: #F1F5F9;
  box-shadow: 8px 0 28px rgba(15, 23, 42, 0.28);
  overflow: auto;
}
.app-nav-drawer[hidden] {
  display: none !important;
}
.app-nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.app-nav-drawer-title {
  font-size: 14px;
  font-weight: 700;
}
.app-nav-drawer-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #E2E8F0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.app-nav-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
}
.app-nav-drawer-label {
  margin: 10px 8px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94A3B8;
}
.app-nav-drawer-label:first-child {
  margin-top: 0;
}
.app-nav-drawer-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius);
  color: #CBD5E1;
  text-decoration: none;
  font-size: 14px;
}
.app-nav-drawer-nav a svg.btn-ico,
.app-nav-drawer-nav a svg.app-nav-ico {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  flex: 0 0 18px;
  opacity: 0.9;
}
.app-nav-drawer-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
}
.app-nav-drawer-nav a.active {
  background: var(--app-active);
  color: var(--app-active-ink);
  font-weight: 600;
}
body.app-nav-open {
  overflow: hidden;
}
.app-m-guide {
  position: sticky;
  top: 57px;
  z-index: 30;
  background: #ECFDF5;
  border-bottom: 1px solid #A7F3D0;
}
.app-m-guide[hidden] {
  display: none !important;
}
.app-m-guide-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  max-width: 100%;
}
.app-m-guide-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: #065F46;
  line-height: 1.4;
}
.app-m-guide-go {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff !important;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none !important;
}
.app-m-guide-go:hover {
  background: var(--accent2);
  color: #fff !important;
}
.app-m-guide-dismiss {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #047857;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.app-topbar-trail {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.app-nav-admin {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: #94A3B8;
  font-size: 13.5px;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.app-nav-admin:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #F8FAFC;
  text-decoration: none;
}
.app-nav-admin.active {
  background: var(--app-active);
  color: var(--app-active-ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent-soft);
}
.app-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: #F1F5F9;
  min-width: 0;
}
.app-user-drop {
  flex: 0 0 auto;
}
.app-user-drop .app-nav-drop-panel {
  left: auto;
  right: 0;
  min-width: 220px;
}
.app-user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 168px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #F1F5F9;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.app-user-menu-btn:hover,
.app-user-drop.is-open > .app-user-menu-btn {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}
.app-user-menu-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}
.app-user-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: calc(var(--radius) - 1px);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #ECFDF5;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(16, 185, 129, 0.28);
}
.app-user-panel-head {
  padding: 10px 12px 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 4px;
}
.app-user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-user-role {
  margin-top: 3px;
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
}
.nav-logout {
  display: block;
  margin: 0;
  padding: 0;
}
.app-user-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b91c1c;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.app-user-logout:hover {
  background: #fef2f2;
  color: #991b1b;
}
.app-user-logout svg.btn-ico,
.app-user-logout svg.app-nav-ico {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
.app-main {
  width: 100%;
  max-width: none;
  padding: 24px 28px 56px;
  box-sizing: border-box;
  background: var(--app-surface);
}
.app-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.app-stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--card-shadow);
  min-width: 0;
}
.app-stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.app-stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.app-stat.warn .app-stat-value { color: var(--warn); }
.app-stat.accent .app-stat-value { color: var(--accent); }
.app-main > h1 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.app-main > h1 + .sub {
  margin-bottom: 18px;
}
.app-body .card {
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}
@media (max-width: 1280px) {
  .app-nav a,
  .app-nav-drop-btn,
  .app-nav-admin {
    padding: 8px 9px;
    gap: 5px;
    font-size: 13px;
  }
  .app-user-menu-name {
    display: none;
  }
  .app-user-menu-btn {
    max-width: none;
    padding: 3px;
  }
  .app-user-menu-btn .app-nav-caret {
    display: none;
  }
}
@media (max-width: 1100px) {
  .app-topbar-inner {
    padding: 10px 14px;
    gap: 10px;
  }
  .app-nav-toggle {
    display: grid;
  }
  .app-nav,
  .app-nav-admin {
    display: none !important;
  }
  .app-topbar-trail {
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
    gap: 6px;
  }
  .app-main { padding: 18px 16px 40px; }
  .app-m-guide { top: 57px; }
  .app-m-guide-inner { padding: 10px 14px; flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .app-brand-title {
    font-size: 14px;
  }
}

.nav-user {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
}
.pill.ok {
  color: var(--ok);
  border-color: var(--add-bd);
  background: var(--add-bg);
}

.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
}
.pill b { color: var(--text); }

h1 { margin: 0 0 6px; font-size: 26px; }
h2 { margin: 0 0 8px; font-size: 18px; }
.sub { color: var(--muted); margin-bottom: 18px; }

.grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; }
@media (max-width: 960px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--card-shadow);
}

input, select, textarea {
  width: 100%;
  height: var(--control-h);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 14px;
  /* Avoid line-height == control height under border-box (looks top-heavy). */
  line-height: 1.25;
  color: var(--text);
  background: #fff;
  transition: border-color var(--ease), box-shadow var(--ease);
}
textarea {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}
input:hover:not(:disabled):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: #D1D5DB;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: var(--focus-ring);
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  vertical-align: middle;
  flex: 0 0 auto;
  box-shadow: none;
}
/* Shared PC file picker: bordered control + selector button (all visible uploads). */
input[type="file"] {
  box-sizing: border-box;
  height: var(--control-h);
  min-height: var(--control-h);
  padding: 5px 8px;
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  display: block;
  max-width: 100%;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  box-sizing: border-box;
  margin: 0 10px 0 0;
  height: calc(var(--control-h) - 12px);
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 12px;
  line-height: calc(var(--control-h) - 14px);
  cursor: pointer;
  vertical-align: middle;
}
input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
/* Toolbar row: custom file pick (中文) + 上传 button — always one line */
.file-upload-inline {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  max-width: 100%;
  vertical-align: middle;
}
.file-pick {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  min-width: 0;
  font-weight: 400;
  color: inherit;
}
.file-pick-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.file-pick-btn {
  flex: 0 0 auto;
  margin: 0 !important;
  height: var(--control-h-sm);
  min-height: var(--control-h-sm);
  padding: 0 10px !important;
  font-size: 12px !important;
  white-space: nowrap;
}
.file-pick-name {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: var(--control-h-sm);
}
.file-upload-inline input[type="file"]:not(.file-pick-input),
.delivery-photo-upload input[type="file"]:not(.file-pick-input) {
  flex: 1 1 14rem;
  width: 14rem;
  min-width: 12rem;
  max-width: 20rem;
  height: var(--control-h-sm);
  min-height: var(--control-h-sm);
}
.file-upload-inline input[type="file"]:not(.file-pick-input)::file-selector-button,
.file-upload-inline input[type="file"]:not(.file-pick-input)::-webkit-file-upload-button,
.delivery-photo-upload input[type="file"]:not(.file-pick-input)::file-selector-button,
.delivery-photo-upload input[type="file"]:not(.file-pick-input)::-webkit-file-upload-button {
  height: calc(var(--control-h-sm) - 10px);
  line-height: calc(var(--control-h-sm) - 12px);
  padding: 0 10px;
  font-size: 12px;
}
.file-upload-inline > .btn-sm {
  flex: 0 0 auto;
  margin: 0;
  align-self: center;
  white-space: nowrap;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--label);
  margin: 0 0 6px;
}

button, .btn {
  margin-top: 0;
  height: var(--control-h);
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease), transform var(--ease);
}
button:hover:not(:disabled):not(.table-icon-link):not(.table-action):not(.ghost):not(.secondary):not(.btn-secondary):not(.status-pill):not(.admin-nav-btn):not(.admin-foot-btn):not(.app-nav-drop-btn):not(.app-user-menu-btn):not(.app-user-logout):not(.notify-bell):not(.notify-read-all):not(.admin-side-toggle):not(.admin-menu-toggle):not(.admin-side-close):not(.app-nav-toggle):not(.danger):not(.is-danger):not(.photo-dlg-danger):not([value="purge"]),
.btn:hover:not(:disabled):not(.table-icon-link):not(.table-action):not(.ghost):not(.secondary):not(.btn-secondary):not(.status-pill):not(.danger):not(.is-danger):not(.photo-dlg-danger):not([value="purge"]) {
  background: var(--accent2);
}
button:active:not(:disabled),
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
button:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
button.secondary, .btn.secondary,
button.btn-secondary, .btn-secondary,
a.secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #D1D5DB;
}
/* Anchors styled as secondary buttons (no .btn class required) */
a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
  height: var(--control-h);
  padding: 0 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
  cursor: pointer;
  box-sizing: border-box;
  transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}
a.secondary.btn-sm {
  height: var(--control-h-sm);
  min-height: var(--control-h-sm);
  padding: 0 10px !important;
  font-size: 12px !important;
}
/* Primary small button look for anchors that only have .btn-sm */
a.btn-sm:not(.secondary):not(.btn-secondary):not(.btn-link):not(.seg-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
  height: var(--control-h-sm);
  min-height: var(--control-h-sm);
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff !important;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
  transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}
a.btn-sm:not(.secondary):not(.btn-secondary):not(.btn-link):not(.seg-btn):hover {
  background: var(--accent2);
  color: #fff !important;
  text-decoration: none !important;
}
a.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none !important;
  box-sizing: border-box;
  white-space: nowrap;
}
a.btn-secondary:hover {
  text-decoration: none !important;
}
button.secondary:hover:not(:disabled),
.btn.secondary:hover:not(:disabled),
button.btn-secondary:hover:not(:disabled),
.btn-secondary:hover:not(:disabled),
a.secondary:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
  color: #111827;
  text-decoration: none !important;
}
button.ghost, .btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid transparent;
  box-shadow: none;
}
button.ghost:hover:not(:disabled),
.btn.ghost:hover:not(:disabled) {
  background: var(--hover-bg);
  border-color: transparent;
  color: var(--accent2);
  text-decoration: underline;
}
.table-action,
a.table-action {
  background: none;
  border: 0;
  padding: 0;
  height: auto;
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.2;
}
.table-action:hover,
a.table-action:hover {
  color: var(--accent2);
  text-decoration: underline;
  background: none;
}
/* 盖过全局 button:hover（accent2 实心底 + 绿色图标 = 看不见） */
button.table-action:hover:not(:disabled),
button.table-action:active:not(:disabled) {
  background: transparent;
  color: var(--accent2);
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}
.table-action svg.btn-ico,
a.table-action svg.btn-ico,
.table-action svg,
a.table-action svg {
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
  flex: 0 0 14px;
  display: block;
  opacity: 0.92;
}
.btn-ico-label {
  min-width: 0;
}
button.btn-sm,
a.btn-sm,
button.secondary.btn-sm,
a.secondary.btn-sm,
button.btn-secondary.btn-sm,
a.btn-secondary.btn-sm,
.btn.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-h-sm);
  min-height: var(--control-h-sm);
  padding: 0 10px;
  font-size: 12px;
  line-height: 1.2;
  box-sizing: border-box;
}
button svg.btn-ico,
.btn svg.btn-ico,
button.secondary svg.btn-ico,
button.btn-secondary svg.btn-ico,
button.ghost svg.btn-ico,
a.btn-link svg.btn-ico,
button.btn-sm svg.btn-ico,
a.btn-sm svg.btn-ico,
button.secondary.btn-sm svg.btn-ico,
a.secondary.btn-sm svg.btn-ico,
button.btn-secondary.btn-sm svg.btn-ico,
a.btn-secondary.btn-sm svg.btn-ico,
.btn.btn-sm svg.btn-ico,
button > svg,
a.btn > svg,
button.btn-sm > svg,
a.btn-sm > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: block;
  opacity: 0.95;
}
button.btn-sm svg.btn-ico,
a.btn-sm svg.btn-ico,
button.secondary.btn-sm svg.btn-ico,
a.secondary.btn-sm svg.btn-ico,
button.btn-secondary.btn-sm svg.btn-ico,
a.btn-secondary.btn-sm svg.btn-ico,
.btn.btn-sm svg.btn-ico,
button.btn-sm > svg,
a.btn-sm > svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}
.result-btn svg.btn-ico {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
/* Author display rules override the UA [hidden] stylesheet. */
button[hidden],
.btn[hidden],
a.btn[hidden],
a.secondary[hidden],
a.btn-link[hidden],
input[type="file"][hidden] {
  display: none !important;
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
/* Only show wait cursor while an action is intentionally in progress */
button[aria-busy="true"],
button.is-busy {
  cursor: wait;
}

/* Form stacks that previously relied on button margin-top */
.admin-form-stack button,
.admin-form-stack .btn,
.card > button,
.card > .btn,
.admin-form-grid + button,
.admin-form-section + button {
  margin-top: 16px;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
}
thead th {
  background: #F9FAFB;
  color: #6B7280;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}
th[data-sort] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th[data-sort]:hover {
  color: var(--accent2);
}
th[data-sort]:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: -2px;
}
th[data-sort]::after {
  content: "↕";
  display: inline-block;
  margin-left: 0.35em;
  font-size: 0.85em;
  font-weight: 500;
  opacity: 0.28;
  color: inherit;
  text-transform: none;
  letter-spacing: 0;
  vertical-align: 0.05em;
}
th[data-sort].is-sorted {
  color: var(--accent2);
}
th[data-sort].is-sorted::after {
  opacity: 1;
  color: var(--accent);
}
th[data-sort].is-sorted-asc::after {
  content: "▲";
}
th[data-sort].is-sorted-desc::after {
  content: "▼";
}
tbody tr {
  transition: background var(--ease);
}
tbody tr:hover td {
  background: var(--hover-bg-soft);
}

.ok { color: var(--ok); }
.bad { color: var(--danger); }
.warn { color: var(--warn); }

#msg, .msg {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-size: 13px;
  min-height: 40px;
}
.msg.success { background: var(--add-bg); border-color: var(--add-bd); }
.msg.error { background: var(--del-bg); border-color: var(--del-bd); }
.msg.warn { background: var(--chg-bg); border-color: var(--chg-bd); }

/* Inline result banner (export / collect success) */
.result-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  width: 100%;
}
.result-banner-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.result-ico {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}
.result-ico svg {
  width: 15px;
  height: 15px;
  display: block;
}
.result-ico-ok {
  background: #059669;
  color: #fff;
}
.result-ico-run {
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent);
}
.result-ico-err {
  background: #b91c1c;
  color: #fff;
}
.result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.msg.success .result-title { color: var(--ok); }
.msg.error .result-title { color: var(--danger); }
.result-banner-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.result-btn {
  margin-top: 0 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 8px 12px !important;
  font-size: 13px !important;
  text-decoration: none !important;
  white-space: nowrap;
}
.result-btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.result-btn.secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--line);
}
.result-btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid transparent;
}
.result-btn.ghost:hover,
button.result-btn.ghost:hover:not(:disabled) {
  border-color: var(--hover-line);
  background: #fff;
  color: var(--accent2);
  transform: none;
}
.result-path {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: min(420px, 100%);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  transition: background var(--ease), border-color var(--ease);
}
.result-path:hover {
  background: #fff;
  border-color: var(--hover-line);
}
.result-path svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--accent);
}
.result-path code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text);
}
.msg:has(.result-banner) {
  display: flex;
  align-items: center;
  min-height: 0;
  padding: 10px 12px;
}

.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.actions-inline { gap: 8px; }
.actions-inline button { margin-top: 10px; }
.btn-sm {
  margin-top: 0 !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}
.check-inline {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  color: var(--text) !important;
  font-size: 13px;
  font-weight: 500;
  width: auto !important;
  max-width: none;
  flex: 0 0 auto;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.2;
}
.check-inline input {
  width: auto !important;
  min-width: 0;
  flex: 0 0 auto;
  margin: 0;
}
.scan-toolbar input { max-width: 240px; }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-right: 4px;
  white-space: nowrap;
  line-height: 1.4;
}
.badge-ipmi,
.badge-rf {
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: #4B5563;
}
.badge-done {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #047857;
}
.badge-ip-history {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #B45309;
}
.badge-new {
  background: #F9FAFB;
  border-color: #E5E7EB;
  color: #6B7280;
}
.badge-weak {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #B91C1C;
}
.badge-manual {
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: #4B5563;
}
.scan-toolbar select {
  width: auto;
  min-width: 150px;
  padding: 6px 10px;
  font-size: 13px;
  margin: 0;
}

/* ---- Scan page layout ---- */
.scan-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.scan-step h2 { margin: 0; }
.scan-step-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.scan-step-head-main {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-desc {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.scan-run-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}
.scan-target-wrap label { margin-top: 0; }
.scan-run-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.scan-run-actions button { margin-top: 0; }
.scan-msg { margin-top: 12px; min-height: 0; }
.scan-progress {
  margin-top: 12px;
}
.scan-progress .progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.scan-progress .progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.scan-progress .progress-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .25s ease;
}
.scan-stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.scan-filters {
  flex-wrap: nowrap;
  margin-bottom: 6px;
  overflow-x: auto;
}
.filter-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.filter-group-grow {
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}
.filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.filter-actions .check-inline {
  display: inline-flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 4px !important;
  width: max-content !important;
  max-width: max-content !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap;
}
.filter-actions .check-inline input[type="checkbox"] {
  box-sizing: border-box;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  max-width: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 14px !important;
  align-self: center;
}
.filter-actions .check-inline span {
  display: inline;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  line-height: 1.2;
}
.filter-group-grow input[type="text"],
.filter-group-grow #hostFilter {
  flex: 1;
  min-width: 140px;
  max-width: 220px;
  margin: 0;
  padding: 6px 10px;
  font-size: 13px;
}
.filter-label {
  font-size: 12px;
  color: var(--muted);
  margin-right: 0;
  white-space: nowrap;
}
.seg {
  display: inline-flex;
  flex-wrap: nowrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.seg-btn {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--text) !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  border-right: 1px solid var(--line) !important;
  white-space: nowrap;
  transition: background var(--ease), color var(--ease) !important;
}
a.seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-h);
  box-sizing: border-box;
  text-decoration: none !important;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}
a.seg-btn svg.btn-ico,
.seg-btn svg.btn-ico {
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
  flex: 0 0 14px;
  display: block;
  opacity: 0.95;
}
.seg-btn:hover:not(.active) {
  background: var(--hover-bg) !important;
}
.seg-btn:last-child { border-right: 0 !important; }
.seg-btn.active {
  background: var(--accent) !important;
  color: #fff !important;
}
.seg-btn.active:hover {
  background: var(--accent2) !important;
  color: #fff !important;
}
.scan-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.scan-table {
  margin: 0;
  width: 100%;
  max-width: 100%;
}
.scan-table th {
  background: #F9FAFB;
  position: sticky;
  top: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6B7280;
}
.scan-table td, .scan-table th { padding: 12px 16px; }
.ip-cell {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: inherit;
}
.mono-cell,
.sn-cell,
td.serial,
code.sn {
  font-family: var(--font-mono);
}
.admin-count-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--hover-bg);
  color: var(--accent2);
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.admin-count-link:hover {
  background: #D1FAE5;
  color: var(--accent2);
  text-decoration: none;
}
a.ip-link { color: var(--accent); }
a.ip-link:hover .ip-cell { text-decoration: underline; color: var(--accent2); }
a.sn-filter-link {
  color: inherit;
  text-decoration: none;
}
a.sn-filter-link:hover code.sn {
  color: var(--accent2);
  text-decoration: underline;
}
a.ip-link {
  transition: color var(--ease);
}
.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px !important;
}
.scan-cred-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 14px;
}
.scan-cred-grid label { margin-top: 0; }
.scan-collect-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.scan-collect-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.scan-collect-actions button { margin-top: 0; }
.ui-shot-editor {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-2, #f8fafc);
}
.ui-shot-editor-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 8px;
}
.ui-shot-set-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ui-shot-set-label > span {
  white-space: nowrap;
  flex-shrink: 0;
}
.ui-shot-set-label select {
  min-width: 11rem;
  max-width: 16rem;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.ui-shot-base-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  flex: 1 1 18rem;
  min-width: 14rem;
  max-width: 36rem;
}
.ui-shot-base-label > span {
  white-space: nowrap;
  flex-shrink: 0;
}
.ui-shot-base-label input {
  flex: 1 1 auto;
  min-width: 12rem;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}
.ui-shot-urls-label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}
.ui-shot-urls {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  resize: vertical;
  min-height: 6.5rem;
  background: #fff;
}
.ui-shot-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  margin: 8px 0;
}
.ui-shot-set-dlg {
  width: min(840px, 96vw);
  max-width: 96vw;
  z-index: 80;
}
.ui-shot-set-card {
  margin: 0;
  padding: var(--dlg-pad);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--dlg-radius);
  box-shadow: var(--dlg-shadow);
}
.ui-shot-set-hint {
  margin-bottom: 0;
}
.ui-shot-set-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.ui-shot-set-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  margin: 0;
}
.ui-shot-set-form input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.ui-shot-set-form textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  resize: vertical;
  min-height: 10rem;
  background: #fff;
}
.ui-shot-set-dlg .dlg-actions {
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
}
.ui-shot-set-dlg .dlg-actions > button,
.ui-shot-set-dlg .dlg-actions > button:not(.btn-sm):not(.table-action) {
  flex: 0 0 auto;
  min-width: 0;
  padding-left: 12px;
  padding-right: 12px;
}
#btnUiShotSetDelete:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ui-shot-cred-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.ui-shot-cred-fields label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}
.ui-shot-cred-fields input {
  min-width: 10rem;
  width: 12rem;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  flex: 0 0 auto;
}
.ui-shot-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2, #f8fafc);
}
.ui-shot-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  margin-bottom: 10px;
}
.ui-shot-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ui-shot-fig {
  margin: 0;
}
.ui-shot-fig figcaption {
  font-size: 12px;
  color: var(--muted, #64748b);
  margin-bottom: 6px;
  font-family: ui-monospace, Consolas, monospace;
}
.ui-shot-fig img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
button.btn-collect-stop,
#btnCollect.btn-collect-stop {
  background: #c62828;
  border-color: #b71c1c;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
button.btn-collect-stop:hover:not(:disabled),
#btnCollect.btn-collect-stop:hover:not(:disabled) {
  background: #b71c1c;
  border-color: #8e0000;
}
.collect-stop-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: currentColor;
  border-radius: 1px;
  flex-shrink: 0;
}
.scan-history summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  list-style: none;
}
.scan-history summary::-webkit-details-marker { display: none; }
.scan-history summary::before {
  content: "? ";
  color: var(--muted);
}
.scan-history[open] summary::before { content: "? "; }
.scan-history table { margin-top: 12px; }

.target-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.target-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #FFFFFF;
}
.target-panel-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}
.badge-manual {
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: #4B5563;
}
.row-flash {
  animation: rowFlash 1.1s ease;
}
@keyframes rowFlash {
  0% { background: #D1FAE5; }
  100% { background: transparent; }
}
.batch-job-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.batch-job {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: space-between;
}
.batch-job-done { background: #f0fdf4; border-color: var(--add-bd); }
.batch-job-done.batch-job-review {
  background: #fffbeb;
  border-color: #fcd34d;
}
.batch-job-failed {
  background: var(--del-bg);
  border-color: var(--del-bd);
}
.batch-job-failed b,
.batch-job-failed .bad {
  color: var(--danger);
}
.batch-job-cancelled {
  background: var(--chg-bg);
  border-color: var(--chg-bd);
}
.batch-job-cancelled .warn {
  color: var(--warn);
}
.batch-job-main { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.batch-job-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.batch-result-btn .status-pill {
  margin-left: 6px;
  vertical-align: middle;
}
.collect-progress .progress-bar > span.is-failed {
  background: linear-gradient(90deg, #DC2626, #F87171);
}
.collect-progress .progress-bar > span.is-partial {
  background: linear-gradient(90deg, #D97706, #FBBF24);
}
.collect-progress.is-failed #progressPercent {
  color: var(--danger);
}
.collect-progress.is-partial #progressPercent {
  color: var(--warn);
}
.batch-job-actions,
.result-links,
.batch-summary-links {
  font-size: 13px;
}
.batch-job-actions a,
.result-links a,
.batch-summary-links a {
  font-weight: 600;
}
.batch-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.batch-summary-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ok);
}
.batch-summary-hosts,
.batch-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.batch-summary-hosts .batch-result-btn,
.batch-summary-actions .btn {
  margin-top: 0 !important;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  text-decoration: none !important;
}
.batch-summary-hosts .batch-result-btn {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.batch-summary-hosts .batch-result-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}
.batch-summary-actions .btn:not(.secondary):not(.ghost) {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.batch-summary-actions .btn.secondary {
  background: #fff;
  color: var(--accent2);
  border: 1px solid #A7F3D0;
}
.batch-summary-actions .btn.secondary:hover {
  background: #ECFDF5;
  border-color: var(--accent);
  color: var(--accent2);
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 18px;
}
.settings-followups {
  margin-top: 0;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}
.settings-group-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: none;
  margin: 2px 0 0;
}
.settings-action-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), box-shadow var(--ease);
}
.settings-action-followup {
  background: #f8fafc;
}
.settings-action-item:hover {
  background: var(--hover-bg-soft);
  border-color: var(--hover-line);
}
.settings-action-item:has(input:checked) {
  border-color: var(--accent);
  background: var(--hover-bg);
  box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.12);
}
.settings-action-item input {
  margin-top: 3px;
}
.settings-action-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.settings-action-title {
  font-weight: 600;
  color: var(--text);
}
.settings-action-cmd {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.settings-result-table .mono-cell {
  max-width: 280px;
}
.settings-result-table .ipmi-out {
  margin: 6px 0 0;
  padding: 8px;
  max-height: 160px;
  overflow: auto;
  font-size: 12px;
  white-space: pre-wrap;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px;
}
.settings-result-table .row-fail {
  background: #fff1f2;
}

#histTable .hist-host-line {
  line-height: 1.45;
  white-space: nowrap;
}
#histTable .hist-host-line + .hist-host-line {
  margin-top: 2px;
}

@media (max-width: 900px) {
  .scan-run-row { grid-template-columns: 1fr; }
  .scan-cred-grid { grid-template-columns: 1fr 1fr; }
  .target-panels { grid-template-columns: 1fr; }
  .scan-filters {
    flex-wrap: wrap;
  }
  .filter-group-grow {
    width: 100%;
    justify-content: flex-start;
  }
}
@media (max-width: 640px) {
  .scan-cred-grid { grid-template-columns: 1fr; }
  .seg-btn { padding: 8px 10px !important; font-size: 12px !important; }
}
.row-collected { background: #f0fdf4; }
.row-new td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

code { font-size: 12px; }

.row { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.row label { margin: 0; color: var(--text); display: inline; }
.row label:has(input[type="checkbox"]),
.row label:has(input[type="radio"]) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}
.row-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.row-check label {
  margin: 0;
  color: var(--text);
  display: inline;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
}

/* Project info searchable picker */
.project-picker {
  position: relative;
  width: 100%;
}
.project-picker-control {
  position: relative;
  display: block;
  width: 100%;
}
.project-picker .project-search {
  width: 100%;
  margin: 0;
  padding-right: 68px;
  box-sizing: border-box;
}
.project-picker button.project-clear,
.project-picker button.project-toggle,
button.project-clear {
  position: absolute !important;
  top: 50%;
  transform: translateY(-50%) !important;
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 8px;
  background: transparent !important;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: none !important;
  z-index: 2;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}
/* !important display above must not override the hidden attribute */
.project-picker button.project-clear[hidden],
.project-picker button.project-toggle[hidden],
button.project-clear[hidden] {
  display: none !important;
}
.project-picker button.project-toggle {
  right: 6px;
  font-size: 12px;
  letter-spacing: 0;
}
.project-picker button.project-clear,
button.project-clear {
  right: 34px;
  font-size: 18px;
}
.project-picker button.project-clear:hover,
.project-picker button.project-toggle:hover,
button.project-clear:hover {
  background: var(--hover-bg) !important;
  color: var(--accent2);
  transform: translateY(-50%) !important;
}
.project-picker button.project-clear:active,
.project-picker button.project-toggle:active,
button.project-clear:active {
  transform: translateY(-50%) !important;
}
.project-picker.open button.project-toggle {
  color: var(--accent2);
}
.project-dropdown {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 280px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  padding: 6px;
}
/* Reset global button styles ? options must be full-width list rows */
button.project-option,
.project-option {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 0 2px !important;
  padding: 10px 12px !important;
  border: none !important;
  border-radius: 10px;
  background: transparent !important;
  color: var(--text) !important;
  box-shadow: none !important;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  transform: none !important;
  transition: background var(--ease), color var(--ease);
}
button.project-option:last-child,
.project-option:last-child {
  margin-bottom: 0 !important;
}
button.project-option:hover:not(:disabled),
button.project-option.active,
button.project-option:focus-visible,
.project-option:hover,
.project-option.active,
.project-option:focus-visible {
  background: var(--hover-bg) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  transform: none !important;
  outline: none;
}
.project-option-title {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  white-space: normal;
  word-break: break-word;
}
.project-option-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: normal;
  word-break: break-word;
}
.project-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
}
.project-detail {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.project-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 12px;
}
.project-detail-grid span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}
.project-detail-grid b {
  font-size: 13px;
  font-weight: 600;
}
.project-picker-inline {
  min-width: 280px;
  flex: 1;
  max-width: 420px;
}

/* ——— List toolbar (unified filter / action bars) ——— */
.list-toolbar,
.toolbar,
.project-toolbar,
.photos-toolbar,
.snap-filter-bar,
.scan-filters,
.barcode-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 12px;
}
.list-toolbar-filters,
.photos-toolbar-filters,
.snap-filter-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  /* Lower basis so actions stay on the same row when width is tight */
  flex: 1 1 12rem;
  min-width: 0;
}
.list-toolbar-actions,
.photos-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 10px;
  flex: 0 0 auto;
  margin-left: auto;
}
.list-toolbar-actions .btn-link,
.list-toolbar-actions button,
.list-toolbar-actions a.secondary,
.photos-toolbar-actions .btn-link,
.photos-toolbar-actions button {
  flex: 0 0 auto;
  white-space: nowrap;
}
.field-grow {
  flex: 1 1 12rem;
  min-width: 8rem;
  max-width: 36rem;
  width: auto;
  margin: 0;
}
/* Title-adjacent toolbars (search + 1–2 actions): keep one row on desktop */
.scan-step-head-main > .list-toolbar,
.admin-panel-head > .list-toolbar:not(.project-toolbar) {
  flex: 1 1 14rem;
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
  margin: 0;
}
.scan-step-head-main > .list-toolbar .list-toolbar-filters,
.admin-panel-head > .list-toolbar:not(.project-toolbar) .list-toolbar-filters {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
}
.scan-step-head-main > .list-toolbar .field-grow,
.admin-panel-head > .list-toolbar:not(.project-toolbar) .field-grow {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}
.field-w-sm {
  width: var(--field-w-sm);
  min-width: 0;
  max-width: var(--field-w-sm);
  flex: 0 0 var(--field-w-sm);
  margin: 0;
}
.field-w-md {
  width: var(--field-w-md);
  min-width: 0;
  max-width: var(--field-w-md);
  flex: 0 0 var(--field-w-md);
  margin: 0;
}
.field-w-lg {
  width: var(--field-w-lg);
  min-width: 0;
  max-width: var(--field-w-lg);
  flex: 0 0 var(--field-w-lg);
  margin: 0;
}
.list-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.list-toolbar select,
.toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.toolbar select,
.project-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.project-toolbar select,
.photos-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.photos-toolbar select,
.snap-filter-bar input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.snap-filter-bar select,
.scan-filters input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.scan-filters select,
.barcode-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.barcode-toolbar select {
  margin: 0;
  height: var(--control-h);
  background: #fff;
}
.list-toolbar .btn-sm,
.list-toolbar button.btn-sm,
.list-toolbar a.btn-sm,
.list-toolbar button.secondary,
.list-toolbar a.secondary,
.list-toolbar button:not(.seg-btn):not(.table-action),
.toolbar .btn-sm,
.toolbar button.btn-sm,
.toolbar a.btn-sm,
.toolbar button.secondary,
.toolbar a.secondary,
.toolbar button:not(.seg-btn):not(.table-action),
.project-toolbar .btn-sm,
.project-toolbar button,
.project-toolbar a.secondary,
.photos-toolbar .btn-sm,
.photos-toolbar button,
.snap-filter-bar .btn-sm,
.snap-filter-bar button,
.scan-filters .btn-sm,
.scan-filters button:not(.seg-btn),
.barcode-toolbar .btn-sm,
.barcode-toolbar button {
  height: var(--control-h);
  margin-top: 0 !important;
  flex: 0 0 auto;
  white-space: nowrap;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.list-toolbar a.seg-btn,
.toolbar a.seg-btn {
  height: var(--control-h);
  padding: 0 10px !important;
}
.admin-panel-head .list-toolbar,
.admin-panel-head .toolbar,
.admin-panel-head .project-toolbar {
  margin: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}
.admin-panel-head .toolbar .filter-actions,
.admin-panel-head .list-toolbar .filter-actions {
  flex: 0 0 auto;
}
.admin-panel-head .toolbar .check-inline,
.admin-panel-head .list-toolbar .check-inline {
  height: auto;
  min-height: 0;
  margin: 0 !important;
}
@media (max-width: 720px) {
  .admin-panel-head {
    flex-direction: column;
  }
  .admin-panel-head .list-toolbar,
  .admin-panel-head .toolbar,
  .admin-panel-head .project-toolbar {
    width: 100%;
    justify-content: flex-start;
  }
  .scan-step-head-main > .list-toolbar,
  .admin-panel-head > .list-toolbar:not(.project-toolbar) {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }
  .scan-step-head-main > .list-toolbar .list-toolbar-filters,
  .admin-panel-head > .list-toolbar:not(.project-toolbar) .list-toolbar-filters {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }
  .list-toolbar-actions,
  .photos-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
  .field-grow {
    flex: 1 1 100%;
    max-width: none;
  }
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.actions .btn { margin-top: 0; }

/* Diff visualization */
.diff-panel { margin-top: 12px; }
.diff-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.diff-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}
.diff-chip.add { background: var(--add-bg); border-color: var(--add-bd); color: var(--ok); }
.diff-chip.del { background: var(--del-bg); border-color: var(--del-bd); color: var(--danger); }
.diff-chip.chg { background: var(--chg-bg); border-color: var(--chg-bd); color: var(--warn); }

.diff-section { margin-top: 14px; }
.diff-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.diff-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.diff-item.add { background: var(--add-bg); border-color: var(--add-bd); }
.diff-item.del { background: var(--del-bg); border-color: var(--del-bd); }
.diff-item.chg { background: var(--chg-bg); border-color: var(--chg-bd); }
.diff-item .title { font-weight: 600; margin-bottom: 4px; }
.diff-item .meta { color: var(--muted); font-size: 12px; }
.diff-empty { color: var(--muted); padding: 12px 0; }

/* Export status */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line);
}
a.status-pill {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
a.status-pill:hover {
  filter: brightness(0.97);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
  text-decoration: none;
  color: inherit;
}
/* Override primary `button` chrome ? pills keep their own palette. */
button.status-pill.is-clickable {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  line-height: 1.2;
  height: auto;
  margin: 0;
  vertical-align: middle;
  background: #F8FAFC;
  color: #475569;
  border: 1px solid #E2E8F0;
  box-shadow: none;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
}
button.status-pill.is-clickable.ok,
button.status-pill.is-clickable.done {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #047857;
}
button.status-pill.is-clickable.pending,
button.status-pill.is-clickable.running {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #B45309;
}
button.status-pill.is-clickable.failed {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #B91C1C;
}
button.status-pill.is-clickable:hover:not(:disabled),
button.status-pill.is-clickable:active:not(:disabled) {
  /* Defeat global button:hover (accent2 fill = same as .ok text ? invisible). */
  transform: none;
  filter: none;
  background: #EEF2F7;
  color: #334155;
  border-color: #94A3B8;
  box-shadow: 0 0 0 2px rgba(71, 85, 105, 0.18);
}
button.status-pill.is-clickable.ok:hover:not(:disabled),
button.status-pill.is-clickable.done:hover:not(:disabled),
button.status-pill.is-clickable.ok:active:not(:disabled),
button.status-pill.is-clickable.done:active:not(:disabled) {
  background: #D1FAE5;
  border-color: #34D399;
  color: #065F46;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.28);
}
button.status-pill.is-clickable.pending:hover:not(:disabled),
button.status-pill.is-clickable.running:hover:not(:disabled),
button.status-pill.is-clickable.pending:active:not(:disabled),
button.status-pill.is-clickable.running:active:not(:disabled) {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #92400E;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.28);
}
button.status-pill.is-clickable.failed:hover:not(:disabled),
button.status-pill.is-clickable.failed:active:not(:disabled) {
  background: #FEE2E2;
  border-color: #F87171;
  color: #991B1B;
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.28);
}
button.status-pill.is-clickable.is-menu-open {
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.35);
}
button.status-pill.is-clickable.ok.is-menu-open,
button.status-pill.is-clickable.done.is-menu-open {
  background: #D1FAE5;
  border-color: #34D399;
  color: #065F46;
}
button.status-pill.is-clickable:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.35);
  outline-offset: 1px;
}
.parts-status-menu {
  min-width: 168px;
  padding: 8px;
  background: var(--card, #fff);
  border: 1px solid #A7F3D0;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(5, 150, 105, 0.08),
    0 14px 32px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.parts-status-menu[hidden] {
  display: none !important;
}
.parts-status-menu-label {
  margin: 0 2px 2px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748B;
}
.parts-status-menu-item {
  appearance: none;
  -webkit-appearance: none;
  height: auto;
  min-height: 36px;
  margin: 0;
  border: 1px solid #D1D5DB;
  background: #F8FAFC;
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}
.parts-status-menu-item:hover:not(:disabled),
.parts-status-menu-item:active:not(:disabled) {
  transform: none;
  background: #EEF2F7;
  border-color: #94A3B8;
  color: #0f172a;
  box-shadow: none;
}
.parts-status-menu-item.is-primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.parts-status-menu-item.is-primary:hover:not(:disabled),
.parts-status-menu-item.is-primary:active:not(:disabled) {
  background: var(--accent2);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.28);
}
.parts-status-menu-item.is-danger {
  background: #FEF2F2;
  border-color: #FECACA;
  color: var(--danger, #b91c1c);
}
.parts-status-menu-item.is-danger:hover:not(:disabled),
.parts-status-menu-item.is-danger:active:not(:disabled) {
  background: #FEE2E2;
  border-color: #F87171;
  color: #991B1B;
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.18);
}
/* Inline claim dialog (home / photos / admin snapshots) */
.claim-snap-dlg {
  width: min(520px, 94vw);
  z-index: 80;
}
.claim-snap-card {
  margin: 0;
  padding: var(--dlg-pad);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--dlg-radius);
  box-shadow: var(--dlg-shadow);
  overflow: visible;
}
.claim-snap-card .project-dropdown {
  z-index: 60;
  /* Keep menu inside dialog hit-testing area as much as possible */
  max-height: min(240px, 42vh);
}
.claim-snap-card > .dlg-title,
.claim-snap-card > h3 {
  margin: 0 0 6px;
  font-size: var(--dlg-title-size);
  font-weight: var(--dlg-title-weight);
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
}
.claim-snap-meta {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.claim-snap-card .photo-dlg-duo {
  margin-top: 10px;
}
.claim-snap-opt-hint {
  margin-top: 10px;
}
.claim-snap-field {
  margin-bottom: 12px;
}
.claim-snap-field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--label);
}
.claim-snap-actions {
  /* matches .dlg-actions */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.claim-snap-actions .claim-snap-more,
.claim-snap-actions .claim-snap-unclaim {
  margin-right: auto;
  font-size: 13px;
}
.claim-snap-actions > button,
.claim-snap-actions > .btn {
  margin-top: 0;
  min-width: 84px;
}

/* 资产详情 · 备注配件（非交付标注） */
.annotate-parts-dlg {
  width: min(1080px, 96vw);
  z-index: 80;
}
.annotate-parts-card {
  display: flex;
  flex-direction: column;
  max-height: min(82vh, 720px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--dlg-radius);
  box-shadow: var(--dlg-shadow);
}
.annotate-parts-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.annotate-parts-head .dlg-title {
  margin: 0;
}
.annotate-parts-head .dlg-sub {
  margin: 4px 0 0;
  max-width: 72ch;
}
.annotate-parts-head-text {
  min-width: 0;
  flex: 1;
}
.annotate-parts-msg {
  flex-shrink: 0;
  margin: 0;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}
.annotate-parts-msg[hidden] {
  display: none !important;
}
.annotate-parts-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
}
.annotate-parts-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}
.annotate-parts-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--label);
  white-space: nowrap;
}
.annotate-parts-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.annotate-parts-table .col-nd {
  width: 3.8em;
  text-align: center;
  padding-left: 8px;
  padding-right: 4px;
}
.annotate-parts-table .col-cat {
  width: 5.5em;
}
.annotate-parts-table .col-loc {
  width: 14%;
}
.annotate-parts-table .col-model {
  width: 26%;
}
.annotate-parts-table .col-sn {
  width: 18%;
  font-variant-numeric: tabular-nums;
}
.annotate-parts-table .col-note {
  width: 28%;
  white-space: normal;
  overflow: visible;
}
.annotate-parts-table .ann-nd-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}
.annotate-parts-table .ann-note {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 5px 8px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.annotate-parts-table .ann-note:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}
.annotate-parts-table tr.is-not-delivery td {
  background: #fffbeb;
}
.annotate-parts-table tr.is-not-delivery .ann-note {
  border-color: #fcd34d;
  background: #fffdf5;
}
.annotate-parts-foot {
  flex-shrink: 0;
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fafafa;
}
@media (max-width: 640px) {
  .annotate-parts-dlg {
    width: min(100vw - 16px, 94vw);
  }
  .annotate-parts-table .col-loc,
  .annotate-parts-table .col-model {
    width: 14%;
  }
  .annotate-parts-table .col-sn {
    width: 14%;
  }
}

.status-pill.pending, .status-pill.running {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #B45309;
}
.status-pill.cancelled {
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: #6B7280;
}
.status-pill.done, .status-pill.ok {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #047857;
}
#assetSnapTable tr.row-closeout td {
  background: rgba(16, 185, 129, 0.06);
}
.status-pill.failed {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #B91C1C;
}
.status-pill.source-email {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}
.status-pill.source-shipping {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #047857;
}
.status-pill.source-local {
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: #4B5563;
}

/* Delivery photos: status + scene color chips */
.status-pill.photo-unclaimed {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #B45309;
}
.status-pill.photo-claimed {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #047857;
}
.status-pill.scene-chassis { background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8; }
.status-pill.scene-label { background: #ECFEFF; border-color: #A5F3FC; color: #0E7490; }
.status-pill.scene-slot { background: #EEF2FF; border-color: #C7D2FE; color: #4338CA; }
.status-pill.scene-cable { background: #F0FDFA; border-color: #99F6E4; color: #0F766E; }
.status-pill.scene-pack { background: #F0FDF4; border-color: #BBF7D0; color: #15803D; }
.status-pill.scene-pallet { background: #ECFDF5; border-color: #A7F3D0; color: #047857; }
.status-pill.scene-truck { background: #FFF7ED; border-color: #FED7AA; color: #C2410C; }
.status-pill.scene-waybill { background: #F5F3FF; border-color: #DDD6FE; color: #6D28D9; }
.status-pill.scene-damage { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
.status-pill.scene-other { background: #F8FAFC; border-color: #E2E8F0; color: #475569; }
.status-pill.scene-job {
  box-shadow: inset 3px 0 0 rgba(5, 150, 105, 0.55);
}
.status-pill.scene-device-kind {
  box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.45);
}
.status-pill.scene-fallback {
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: #4B5563;
}
.photo-scene-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  max-width: 100%;
}
.photo-scene-kind {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.photo-scene-kind-device {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.photo-scene-kind-job {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.photo-scene-kind-shared {
  color: #6d28d9;
  background: #f5f3ff;
  border-color: #ddd6fe;
}
.photo-scene-main {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}
.photo-scene-view {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  opacity: 0.9;
}
.photo-belong {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  line-height: 1.35;
}
.photo-belong-primary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}
.photo-belong-secondary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #64748b;
}
.photo-belong-secondary a {
  color: #475569;
}
.photo-belong-secondary a:hover {
  color: var(--accent2);
}
/* ????????????????? ???????? */
.photo-belong-job-full {
  display: none;
}
.photo-belong-job-short {
  display: inline;
}
@media (min-width: 1440px) {
  .photo-belong-job-short {
    display: none;
  }
  .photo-belong-job-full {
    display: inline;
  }
}
.photo-belong-job-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 1px 7px;
  letter-spacing: 0.02em;
}
.photo-belong-warn {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  padding: 1px 7px;
  letter-spacing: 0.02em;
}

/* Delivery photos detail dialog — width/padding beat .project-detail-card (defined later) */
.photo-dlg-card {
  max-height: 94vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--dlg-radius);
  box-shadow: var(--dlg-shadow);
  border: 1px solid var(--line);
}
.photo-dlg-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}
.photo-dlg-head-main { min-width: 0; flex: 1; }
.photo-dlg-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.photo-dlg-title-row h2,
.photo-dlg-title-row .dlg-title {
  margin: 0;
  font-size: var(--dlg-title-size);
  font-weight: var(--dlg-title-weight);
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}
.photo-dlg-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.photo-dlg-belong {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.photo-dlg-belong-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.photo-dlg-belong-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
  color: #334155;
}
.photo-dlg-belong-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  color: #64748b;
}
.photo-dlg-belong-row {
  display: inline;
  grid-template-columns: none;
  gap: 6px 10px;
  align-items: baseline;
  min-width: 0;
  line-height: 1.45;
}
.photo-dlg-belong-row + .photo-dlg-belong-row::before {
  content: "?";
  margin: 0 8px;
  color: #cbd5e1;
  font-weight: 600;
}
.photo-dlg-belong-row.is-plain {
  display: inline;
}
.photo-dlg-belong-k {
  color: #94a3b8;
  font-weight: 600;
  flex-shrink: 0;
  margin-right: 4px;
}
.photo-dlg-belong-v {
  display: inline;
  min-width: 0;
  color: #475569;
  word-break: break-word;
}
.photo-dlg-belong-time .photo-dlg-belong-v {
  font-variant-numeric: tabular-nums;
}
.photo-dlg-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.photo-dlg-nav-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  padding: 4px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  border-radius: 4px !important;
  line-height: 1.3 !important;
}
.photo-dlg-nav-ico {
  font-size: 13px;
  line-height: 1;
  opacity: 0.75;
}
.photo-dlg-body {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(240px, 0.95fr) minmax(220px, 0.85fr);
  gap: 12px 14px;
  align-items: stretch;
  padding: 12px 16px 16px;
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
  background: #f1f5f9;
}
.photo-dlg-preview-col,
.photo-dlg-form-col,
.photo-dlg-side-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.photo-dlg-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-width: 0;
}
.photo-dlg-preview-panel {
  padding: 10px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.photo-dlg-panel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #64748b;
  margin: 0 0 10px;
}
.photo-dlg-note-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.photo-dlg-note-panel .photo-dlg-field,
.photo-dlg-note-panel textarea {
  flex: 1 1 auto;
  min-height: 96px;
}
.photo-dlg-preview {
  position: relative;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  min-height: 240px;
  max-height: none;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: none;
}
.photo-dlg-preview-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 240px;
  max-height: min(62vh, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  position: relative;
}
.photo-dlg-preview img,
.photo-dlg-preview-btn img {
  display: block;
  max-width: 100%;
  max-height: min(62vh, 560px);
  object-fit: contain;
  border-radius: 0;
}
.photo-dlg-preview-loading {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
}
.photo-dlg-preview-loading.is-error {
  background: rgba(127, 29, 29, 0.85);
}
.photo-dlg-preview-hint {
  margin: 8px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: #94a3b8;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
.photo-thumb-wrap {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  display: inline-flex;
  vertical-align: middle;
  cursor: pointer;
}
.photo-thumb-wrap .photo-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: #e2e8f0;
  display: block;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.photo-thumb-wrap:hover .photo-thumb {
  box-shadow: 0 0 0 2px #94a3b8;
  transform: scale(1.04);
}
.photo-thumb-pop {
  position: fixed;
  z-index: 1200;
  display: none;
  pointer-events: none;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
}
.photo-thumb-pop.is-open { display: block; }
.photo-thumb-pop img {
  display: block;
  width: 240px;
  height: 240px;
  object-fit: contain;
  background: #0f172a;
  border-radius: 6px;
}
/* photos-toolbar / filters / actions: aliased to list-toolbar above */
.photos-sel-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.photos-sel-bar[hidden] {
  display: none !important;
}
.photos-sel-summary {
  font-size: 13px;
  font-weight: 650;
  color: #334155;
  margin-right: 4px;
}
.photo-input-scan {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.photo-input-scan:focus-within {
  box-shadow: var(--focus-ring);
  border-color: #86efac;
}
.photo-input-scan input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent;
}
.photo-btn-scan-ico {
  flex: 0 0 42px;
  width: 42px;
  border: 0;
  border-left: 1px solid var(--line);
  background: #f1f5f9;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.photo-btn-scan-ico:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.photo-btn-scan-ico:active {
  background: #dbeafe;
  color: #1d4ed8;
}
.photo-btn-scan-ico svg {
  width: 20px;
  height: 20px;
  display: block;
}
.photo-serial-scan-tip {
  margin: 6px 0 0;
}
.photo-serial-scan-tip[hidden] {
  display: none !important;
}
.claim-snap-card .photo-input-scan {
  margin-top: 0;
}
.claim-snap-card .photo-dlg-duo label {
  display: block;
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.claim-snap-card .photo-dlg-duo select {
  width: 100%;
}
.photos-claim-grid {
  margin-top: 12px;
  align-items: flex-end;
}
.photos-claim-grid[hidden],
.claim-form-grid[hidden] {
  display: none !important;
}
.photos-token-cap {
  margin: 0 0 8px;
}
.photo-missing-pill,
.photo-missing-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 1px 7px;
  line-height: 1.4;
  white-space: nowrap;
}
.photo-row-missing {
  background: #fff7f7;
}
/* ??????????? + ????????????????????? */
#photoTable {
  table-layout: fixed;
  width: 100%;
}
#photoTable > thead > tr > th,
#photoTable > tbody > tr > td {
  vertical-align: middle;
}
#photoTable .col-check {
  width: 2.4rem;
  padding-left: 0.35rem;
  padding-right: 0.2rem;
  text-align: center;
  white-space: nowrap;
}
#photoTable .col-index {
  width: 3rem;
  padding-left: 0.25rem;
  padding-right: 0.5rem;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#photoTable .col-preview {
  width: 4.25rem;
  padding-left: 0.25rem;
  text-align: center;
  white-space: nowrap;
}
#photoTable .col-time {
  width: 9.25rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
#photoTable .col-status {
  width: 5.25rem;
  white-space: nowrap;
}
#photoTable .col-scene {
  width: 7.25rem;
  white-space: normal;
  overflow: hidden;
}
#photoTable .col-belong,
#photoTable > thead > tr > th.col-belong,
#photoTable > tbody > tr > td.col-belong {
  /* ????????SN + ??/??/??? */
  width: auto;
  min-width: 14rem;
  max-width: none;
  overflow: hidden;
  white-space: normal;
}
#photoTable .col-belong code {
  font-size: 12px;
}
#photoTable .col-belong .sn-with-barcode {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
}
#photoTable .col-belong .photo-belong-primary,
#photoTable .col-belong .photo-belong-secondary {
  max-width: 100%;
}
#photoTable .col-note {
  width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
#photoTable .col-uploader {
  width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
#photoTable .col-file,
#photoTable > thead > tr > th.col-file,
#photoTable > tbody > tr > td.col-file {
  /* ??? + ??/??????????????? */
  width: 14.5rem;
  min-width: 12.5rem;
  max-width: 14.5rem;
  overflow: hidden;
  white-space: nowrap;
  padding-right: 0.5rem;
}
#photoTable .photo-file-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
#photoTable .photo-file-name {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
#photoTable .photo-file-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
#photoTable .photo-file-actions .table-action {
  margin: 0;
}
/* ?1280????????????? */
@media (min-width: 1280px) {
  #photoTable .col-file,
  #photoTable > thead > tr > th.col-file,
  #photoTable > tbody > tr > td.col-file {
    width: 16rem;
    max-width: 16rem;
  }
  #photoTable .col-note { width: 9rem; }
  #photoTable .col-uploader { width: 6rem; }
  #photoTable .col-scene { width: 7.75rem; }
}
/* ?1440????????????? */
@media (min-width: 1440px) {
  #photoTable .col-file,
  #photoTable > thead > tr > th.col-file,
  #photoTable > tbody > tr > td.col-file {
    width: 17.5rem;
    max-width: 17.5rem;
  }
  #photoTable .col-note { width: 10.5rem; }
  #photoTable .col-uploader { width: 6.5rem; }
  #photoTable .col-time { width: 9.5rem; }
}
@media (min-width: 1680px) {
  #photoTable .col-file,
  #photoTable > thead > tr > th.col-file,
  #photoTable > tbody > tr > td.col-file {
    width: 18.5rem;
    max-width: 18.5rem;
  }
  #photoTable .col-scene { width: 8.25rem; }
}
/* ??????????????????? */
@media (max-width: 1100px) {
  #photoTable { min-width: 1020px; }
  #photoTable .col-time { width: 8.75rem; }
  #photoTable .col-scene { width: 6.75rem; }
  #photoTable .col-belong,
  #photoTable > thead > tr > th.col-belong,
  #photoTable > tbody > tr > td.col-belong {
    min-width: 12rem;
  }
  #photoTable .col-file,
  #photoTable > thead > tr > th.col-file,
  #photoTable > tbody > tr > td.col-file {
    width: 13.5rem;
    max-width: 13.5rem;
  }
}
.photo-dlg-form-col .photo-dlg-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.photo-dlg-form-col .photo-dlg-panel-title {
  margin-bottom: 0;
}
.photo-dlg-field {
  min-width: 0;
}
.photo-dlg-form-col label {
  display: block;
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.35;
}
.photo-dlg-form-col input,
.photo-dlg-form-col select,
.photo-dlg-form-col textarea {
  width: 100%;
  border-radius: 4px;
  padding: 8px 10px;
  line-height: 1.4;
}
.photo-dlg-form-col textarea {
  resize: none;
  min-height: 78px;
  line-height: 1.5;
}
.photo-dlg-form-col .photo-input-scan {
  border-radius: 4px;
}
.photo-dlg-form-col .photo-input-scan input {
  padding: 8px 10px;
}
.photo-dlg-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.photo-dlg-type-label {
  display: block;
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.35;
}
.photo-type-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border, #d0d5dd);
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface-2, #f4f6f8);
}
.photo-type-seg-btn {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  padding: 8px 10px;
  cursor: pointer;
}
.photo-type-seg-btn + .photo-type-seg-btn {
  border-left: 1px solid var(--border, #d0d5dd);
}
.photo-type-seg-btn:hover {
  color: var(--text, #1f2937);
  background: rgba(255, 255, 255, 0.55);
}
.photo-type-seg-btn.is-active {
  color: var(--text, #1f2937);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.photo-type-seg-btn:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: -2px;
  z-index: 1;
}
.photo-dlg-meta {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.photo-dlg-meta-title {
  display: none;
}
.photo-dlg-meta-dl {
  margin: 0;
  display: grid;
  gap: 8px;
}
.photo-dlg-meta-row {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 8px 12px;
  align-items: baseline;
  font-size: 12.5px;
  line-height: 1.45;
}
.photo-dlg-meta-row dt {
  margin: 0;
  color: #94a3b8;
  font-weight: 600;
}
.photo-dlg-meta-row dd {
  margin: 0;
  color: #334155;
  min-width: 0;
  word-break: break-word;
}
.photo-meta-ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.photo-dlg-meta-more {
  margin-top: 10px;
  font-size: 12px;
}
.photo-dlg-meta-more > summary {
  cursor: pointer;
  color: #64748b;
  font-weight: 600;
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.photo-dlg-meta-more > summary::-webkit-details-marker { display: none; }
.photo-dlg-meta-more > summary::before {
  content: "?";
  font-size: 10px;
  line-height: 1;
  color: #94a3b8;
  transition: transform var(--ease);
}
.photo-dlg-meta-more[open] > summary::before {
  transform: rotate(90deg);
}
.photo-dlg-meta-more[open] > summary {
  margin-bottom: 8px;
}
.photo-dlg-meta-more-label {
  border-bottom: 1px dashed transparent;
}
.photo-dlg-meta-more > summary:hover .photo-dlg-meta-more-label {
  border-bottom-color: #cbd5e1;
}
.photo-dlg-meta-empty {
  margin: 0;
}
.photo-dlg-warn {
  color: #b91c1c;
  font-weight: 650;
}
.photo-meta-copy {
  appearance: none;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  padding: 0 0 0 4px;
  vertical-align: baseline;
}
.photo-meta-copy:hover { text-decoration: underline; }
.photo-meta-path {
  font-size: 11.5px;
  word-break: break-all;
}
.photo-dlg-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.photo-dlg-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #475569;
  max-width: none;
}
.photo-dlg-opt input {
  width: auto;
  margin: 0;
  margin-top: 0;
  accent-color: var(--accent);
}
.photo-dlg-opt[hidden] {
  display: none !important;
}
.photo-dlg-footer {
  flex-shrink: 0;
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid var(--line);
}
.photo-dlg-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0;
  flex-wrap: wrap;
}
.photo-dlg-actions-left,
.photo-dlg-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.photo-dlg-actions-right {
  margin-left: auto;
}
.photo-dlg-actions .btn-sm,
.photo-dlg-actions a.btn-link.btn-sm {
  border-radius: 4px;
}
.photo-dlg-actions .photo-dlg-aux {
  font-weight: 600;
  color: #475569;
}
.photo-dlg-actions a.photo-dlg-aux {
  color: var(--accent);
}
.photo-dlg-actions .photo-dlg-save,
.photo-dlg-actions #btnPhotoSave {
  box-shadow: 0 1px 2px rgba(4, 120, 87, 0.2);
  font-weight: 650;
  padding-left: 14px;
  padding-right: 14px;
  border-radius: 4px;
}
.photo-dlg-download {
  padding: 6px 10px !important;
  font-size: 12px !important;
  border-radius: 4px !important;
}
button.photo-dlg-danger,
.photo-dlg-danger {
  background: #fff;
  color: #b91c1c;
  border: 1px solid #f1a8a8;
  font-weight: 650;
  border-radius: 4px;
}
button.photo-dlg-danger:hover:not(:disabled),
.photo-dlg-danger:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
  text-decoration: none;
}
.photo-dlg-missing {
  padding: 28px 16px;
  text-align: center;
  color: #94a3b8;
  line-height: 1.5;
}
.photo-lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  box-shadow: none;
}
.photo-lightbox::backdrop {
  background: var(--dlg-backdrop-deep);
  backdrop-filter: none;
}
.photo-lightbox-inner {
  position: relative;
  width: min(96vw, 1200px);
  min-height: 40vh;
  max-height: 94vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 12px 16px;
  box-sizing: border-box;
}
.photo-lightbox-inner img {
  display: block;
  max-width: 100%;
  max-height: calc(94vh - 72px);
  object-fit: contain;
  border-radius: 6px;
  background: #020617;
}
.photo-lightbox-inner .photo-lightbox-stage img {
  max-height: calc(94vh - 132px);
}
.photo-lightbox-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: #f8fafc;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.photo-lightbox-close:hover {
  background: rgba(148, 163, 184, 0.35);
}
.photo-lightbox-hint {
  margin: 0;
  color: #cbd5e1;
  text-align: center;
}
.photo-lightbox-hint a {
  color: #93c5fd;
}
.delivery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #f8fafc;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.delivery-lightbox-nav:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.8);
}
.delivery-lightbox-nav:disabled,
.delivery-lightbox-nav[aria-disabled="true"] {
  opacity: 0.28;
  cursor: default;
}
.delivery-lightbox-prev {
  left: 8px;
}
.delivery-lightbox-next {
  right: 8px;
}
.photo-lightbox-stage {
  width: min(96vw, 1200px);
  max-height: calc(94vh - 132px);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overscroll-behavior: contain;
}
.photo-lightbox-stage img {
  max-width: 100%;
  max-height: calc(94vh - 132px);
  transform: translate(var(--lb-pan-x, 0px), var(--lb-pan-y, 0px)) scale(var(--lb-zoom, 1));
  transform-origin: center center;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}
.photo-lightbox-stage img.is-zoomed {
  max-width: none;
  max-height: none;
  cursor: grab;
}
.photo-lightbox-stage img.is-zoomed.is-panning {
  cursor: grabbing;
}
.photo-lightbox-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.photo-lightbox-zoom {
  min-width: 40px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #f8fafc;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.photo-lightbox-zoom:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.8);
}
.photo-lightbox-zoom:disabled {
  opacity: 0.35;
  cursor: default;
}
.photo-lightbox-zoom-pct {
  min-width: 52px;
  text-align: center;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.delivery-photo-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  background: #0f172a;
  vertical-align: middle;
}
.delivery-photo-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 10px;
  min-width: 0;
  overflow-x: auto;
}
.delivery-photo-bar > .delivery-actions {
  margin-top: 0;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.delivery-photo-bar > .delivery-photo-upload {
  margin-top: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.delivery-photo-upload {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 0;
  min-width: 0;
}
.delivery-photo-upload > .hint {
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}
.delivery-photo-upload select {
  width: auto;
  min-width: 4.5rem;
  max-width: 7.5rem;
  margin: 0;
  flex: 0 0 auto;
}
.delivery-photo-upload input[type="text"] {
  flex: 1 1 5rem;
  min-width: 4.5rem;
  max-width: 8rem;
  margin: 0;
}
.delivery-photo-upload > .file-upload-inline {
  flex: 1 1 16rem;
  min-width: 14rem;
  max-width: 100%;
}
.delivery-photo-upload .btn-sm {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .delivery-photo-bar {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .delivery-photo-bar > .delivery-photo-upload {
    flex: 1 1 100%;
  }
  .delivery-photo-bar > .delivery-actions {
    flex-wrap: wrap;
    white-space: normal;
  }
}
@media (max-width: 640px) {
  .delivery-lightbox-nav {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }
  .delivery-lightbox-prev { left: 4px; }
  .delivery-lightbox-next { right: 4px; }
}
@media (max-width: 1100px) {
  .photo-dlg-body {
    grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr);
  }
  .photo-dlg-side-col {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}
@media (max-width: 820px) {
  .photo-dlg-body { grid-template-columns: 1fr; }
  .photo-dlg-side-col { grid-template-columns: 1fr; }
  .photo-dlg-preview,
  .photo-dlg-preview-btn { max-height: 42vh; min-height: 180px; }
  .photo-dlg-preview img,
  .photo-dlg-preview-btn img { max-height: 42vh; }
  .photo-dlg-form-col {
    max-height: none;
  }
  .photo-dlg-actions-right {
    margin-left: 0;
  }
}

.pill-gap {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #FFF7ED;
  border: 1px solid #FDBA74;
  color: #C2410C;
  white-space: nowrap;
}

/* Title above; toolbar full-width so filters + actions can share one row */
#projectListCard .admin-panel-head {
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 10px;
  gap: 10px;
}
#projectListCard .project-toolbar,
#projectListCard .list-toolbar.project-toolbar {
  width: 100%;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
}
#projectListCard .project-toolbar .list-toolbar-filters {
  flex: 1 1 auto;
  min-width: 0;
}
#projectListCard .project-toolbar .list-toolbar-actions {
  flex: 0 0 auto;
  margin-left: auto;
  width: auto;
}
.project-toolbar-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  margin: 0;
  cursor: pointer;
  flex: 0 0 auto;
  height: var(--control-h);
}
.project-toolbar-check input {
  width: auto;
  height: auto;
  margin: 0;
}
@media (max-width: 720px) {
  #projectListCard .project-toolbar,
  #projectListCard .list-toolbar.project-toolbar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  #projectListCard .project-toolbar .list-toolbar-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  #projectListCard .project-toolbar .field-grow {
    flex: 1 1 100%;
    max-width: none;
  }
}
/* auto + width:1%???????????? fixed ???????/??/?? */
#projectTable {
  table-layout: auto;
}
#projectTable .col-check,
#projectTable .col-index,
#projectTable .col-time,
#projectTable .col-assets {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}
#projectTable .col-check {
  padding: 10px 2px 10px 0 !important;
  text-align: center;
}
#projectTable .col-index {
  min-width: 0 !important;
  padding: 10px 2px !important;
  text-align: right;
}
#projectTable .col-time {
  padding: 8px 8px 8px 2px !important;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  white-space: nowrap;
}
#projectTable .project-time-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  line-height: 1.25;
}
#projectTable .project-time-val {
  font-variant-numeric: tabular-nums;
}
/* 紧凑流水线：进度点 + 当前态 pill */
#projectTable .col-status {
  width: 1%;
  min-width: 8.5rem;
  white-space: nowrap;
  vertical-align: middle;
  padding: 10px 6px !important;
  text-align: left;
}
#projectTable .project-pipeline {
  flex-wrap: nowrap;
  max-width: none;
  gap: 6px;
  align-items: center;
}
#projectTable .project-pipeline .pill-gap {
  flex: 0 0 auto;
}
#projectTable .project-pipeline .status-pill.is-clickable,
#projectTable .project-pipeline button.status-pill {
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  appearance: none;
  -webkit-appearance: none;
}
#projectTable .project-pipeline button.status-pill:hover,
#projectTable .project-pipeline button.status-pill:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent, #2563eb) 55%, transparent);
  outline-offset: 1px;
}
/* 与结项弹窗同宽；正文由 .project-detail-body 弹性滚动 */
.project-gaps-dlg > .project-detail-card {
  width: var(--admin-workflow-dlg-w);
}
.project-gaps-dlg .project-gaps-body {
  max-height: none;
}
.project-gaps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.project-gaps-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--hover-bg-soft, #fafafa);
}
.project-gaps-item.level-block {
  border-color: color-mix(in srgb, #dc2626 28%, var(--border, #e5e7eb));
  background: color-mix(in srgb, #dc2626 6%, #fff);
}
.project-gaps-item.level-warn {
  border-color: color-mix(in srgb, #d97706 28%, var(--border, #e5e7eb));
  background: color-mix(in srgb, #d97706 6%, #fff);
}
.project-gaps-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.project-gaps-label {
  font-size: 13px;
  font-weight: 600;
}
.project-gaps-detail {
  font-size: 12px;
  color: var(--muted, #6b7280);
  line-height: 1.45;
  margin: 2px 0 8px;
}
.project-gaps-fix {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  font-size: 12px;
  line-height: 1.4;
}
.project-gaps-fix-k {
  flex: 0 0 auto;
  color: var(--muted, #6b7280);
  font-weight: 600;
}
.project-gaps-fix-v {
  flex: 1 1 12rem;
  min-width: 0;
}
.project-gaps-action {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 12px;
  color: var(--accent, #2563eb);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}
.project-gaps-action:hover {
  text-decoration: underline;
}
#projectTable th.col-project-ref,
#projectTable td.col-project-ref {
  min-width: 8rem;
  max-width: 14rem;
  white-space: normal;
  vertical-align: middle;
  word-break: break-word;
  overflow-wrap: anywhere;
}
#projectTable .col-sales {
  width: 1%;
  max-width: 5.5rem;
  white-space: nowrap;
  padding-left: 8px !important;
  padding-right: 8px !important;
}
#projectTable .col-assets {
  padding: 10px 10px !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
#projectTable .col-actions,
#projectTable td.table-actions {
  width: var(--project-actions-sticky-w);
  min-width: var(--project-actions-sticky-w);
  max-width: var(--project-actions-sticky-w);
  white-space: nowrap;
}
#projectTable .status-pill {
  padding: 0 5px;
  font-size: 11px;
  line-height: 1.45;
  min-width: 0;
}
#projectTable td.col-project-ref .admin-count-link {
  white-space: nowrap;
}
#projectTable td.col-project-ref .project-name-wrap {
  margin: 2px 0 0;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
#projectTable tr.project-row {
  cursor: pointer;
}
#projectTable tr.project-row:hover > td {
  background: rgba(15, 23, 42, 0.02);
}
#projectTable a.table-action {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.project-detail-dlg {
  max-width: 98vw;
}
.project-detail-card {
  box-shadow: var(--dlg-shadow);
  width: min(1100px, 96vw);
  max-height: 90vh;
  overflow: auto;
  margin: 0;
  padding: var(--dlg-pad);
}
/* Job detail: sticky head/actions like closeout; body scrolls */
.project-detail-dlg > .project-detail-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 92vh;
}
.project-detail-dlg .project-detail-head {
  flex: 0 0 auto;
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.project-detail-dlg .project-detail-body {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  padding: 12px 2px 4px 0;
}
.project-detail-dlg .project-detail-actions {
  flex: 0 0 auto;
  margin-top: 8px;
}
.project-detail-dlg .project-detail-sub-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.project-detail-dlg .project-detail-sub-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.project-detail-sec {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 10px;
  background: var(--card, #fff);
}
.project-detail-sec:last-child {
  margin-bottom: 0;
}
.project-detail-sec > .project-detail-h {
  margin: 0 0 10px;
}
.project-detail-fold {
  margin: 0;
  border: none;
  padding: 0;
}
.project-detail-fold > summary {
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.project-detail-fold > summary::-webkit-details-marker {
  display: none;
}
.project-detail-fold > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--muted);
  transition: transform 0.12s ease;
}
.project-detail-fold[open] > summary::before {
  transform: rotate(90deg);
}
.project-detail-fold > summary .hint {
  font-weight: 400;
}
.project-detail-fold-body {
  margin-top: 10px;
}
.project-detail-photo-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: 10px;
}
.project-detail-photo-tools > .table-action,
.project-detail-photo-tools > label.table-action {
  display: inline-flex;
  align-items: center;
  margin: 0;
  font-weight: 500;
  line-height: 1.2;
}
.project-detail-photo-tools select {
  width: auto;
  min-width: 7rem;
  margin: 0;
}
.project-detail-photo-tools input[type="text"] {
  flex: 1 1 12rem;
  min-width: 10rem;
  margin: 0;
}
/* Photo detail: wider, flush chrome (overrides .project-detail-card width/pad) */
.photo-dlg .photo-dlg-card.project-detail-card {
  width: min(1180px, 97vw);
  max-height: 94vh;
  padding: 0;
  overflow: hidden;
}
.project-detail-card > .dlg-head,
.project-detail-head,
.closeout-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.dlg-head-main {
  min-width: 0;
}
.dlg-head-close {
  flex: 0 0 auto;
}
.project-detail-card .dlg-title,
.project-detail-card h2.dlg-title {
  margin: 0;
  font-size: var(--dlg-title-size);
  font-weight: var(--dlg-title-weight);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.project-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.project-detail-actions > button,
.project-detail-actions > .btn,
.project-detail-actions > a {
  margin-top: 0;
}
.project-detail-actions > button:not(.btn-sm):not(.table-action),
.project-detail-actions > .btn:not(.btn-sm) {
  min-width: 84px;
}
.project-detail-actions-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-right: auto;
}
.project-detail-body {
  font-size: 13px;
}
.project-detail-h {
  font-size: 13px;
  margin: 14px 0 8px;
}
/* Job detail grid: fixed 2-col (picker uses auto-fit elsewhere) */
.project-detail-body .project-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 28px;
}
.project-detail-body .project-detail-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 4px 12px;
  align-items: baseline;
  min-width: 0;
}
.project-detail-body .project-detail-row.is-wide {
  grid-column: 1 / -1;
}
.project-detail-body .project-detail-row > .hint {
  margin: 0;
  line-height: 1.45;
}
.project-detail-body .project-detail-row > div:last-child {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.project-detail-emails {
  width: 100%;
  table-layout: fixed;
  font-size: 12px;
}
.project-detail-emails th,
.project-detail-emails td {
  white-space: normal !important;
  vertical-align: top;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.project-detail-emails .col-sent {
  width: 8.5rem;
  white-space: nowrap !important;
  word-break: keep-all;
  overflow-wrap: normal;
}
.project-detail-emails .col-subject {
  width: auto;
}
.project-detail-emails .col-status {
  width: 9rem;
  white-space: nowrap !important;
  word-break: keep-all;
  overflow-wrap: normal;
}
.project-detail-emails .col-status .status-pill {
  white-space: nowrap;
  max-width: none;
}
.project-detail-emails .col-act {
  width: 8.5rem;
  white-space: nowrap !important;
  word-break: keep-all;
  overflow-wrap: normal;
}
@media (max-width: 720px) {
  .project-detail-body .project-detail-grid {
    grid-template-columns: 1fr;
  }
  .project-detail-body .project-detail-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .project-detail-actions-nav {
    margin-right: 0;
    width: 100%;
  }
}

/* ????????????/??????? nowrap ?? */
#smEmailTable {
  table-layout: fixed;
  width: 100%;
}
#smEmailTable > thead > tr > th,
#smEmailTable > tbody > tr > td {
  white-space: normal !important;
  vertical-align: top;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
#smEmailTable .col-index {
  width: 2.5rem;
  white-space: nowrap !important;
}
#smEmailTable .col-party {
  width: 16%;
}
#smEmailTable .col-subject {
  width: 34%;
}
#smEmailTable .col-from {
  width: 9%;
}
#smEmailTable .col-to {
  width: 16%;
}
#smEmailTable .col-sent {
  width: 8.25rem;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums;
}
#smEmailTable .col-act {
  width: 4rem;
  white-space: nowrap !important;
}
#smEmailTable .sm-cell-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.closeout-dlg .closeout-card {
  width: var(--admin-workflow-dlg-w);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: var(--dlg-pad);
  box-shadow: var(--dlg-shadow);
}
.closeout-head {
  flex: 0 0 auto;
}
.closeout-body {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  padding-right: 2px;
}
.closeout-foot {
  flex: 0 0 auto;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
/* Options sit above buttons; only one divider (foot top + dlg-actions top) */
.closeout-foot .closeout-actions {
  border-top: none;
  padding-top: 0;
}
.closeout-foot .dlg-actions {
  margin-top: 12px;
}
.closeout-foot .msg {
  margin-top: 8px;
}
.closeout-overall {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.45;
  flex: 0 0 auto;
}
.closeout-overall.is-ok {
  background: #ecfdf5;
  color: #065f46;
}
.closeout-overall.is-warn {
  background: #fffbeb;
  color: #92400e;
}
.closeout-overall.is-block {
  background: #fef2f2;
  color: #991b1b;
}
.closeout-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.closeout-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.closeout-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 820px) {
  .closeout-layout {
    grid-template-columns: 1fr;
  }
  .closeout-panel-checks {
    position: static;
    max-height: none;
  }
}
@media (max-width: 720px) {
  .closeout-two {
    grid-template-columns: 1fr;
  }
}
.closeout-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--hover-bg-soft, #fafbfc);
}
.closeout-panel-att {
  background: var(--card, #fff);
}
.closeout-panel-ship {
  background: var(--card, #fff);
}
.closeout-panel-checks {
  background: var(--card, #fff);
  position: sticky;
  top: 0;
  max-height: min(72vh, 36rem);
  overflow: auto;
  z-index: 1;
}
.closeout-ship-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.closeout-ship-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  background: var(--hover-bg-soft, #f8fafc);
}
.closeout-ship-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.closeout-ship-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.closeout-ship-compact {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 10px 12px;
  align-items: start;
}
.closeout-ship-compact label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}
.closeout-ship-compact input,
.closeout-ship-compact select {
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
}
.closeout-ship-from {
  grid-column: 1 / -1;
}
.closeout-ship-compact .closeout-ship-span2 {
  grid-column: 1 / -1;
}
.co-ship-from-hint {
  margin-top: 4px;
  line-height: 1.35;
}
@media (max-width: 720px) {
  .closeout-ship-compact {
    grid-template-columns: 1fr;
  }
}
.closeout-att-ack {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: #fff7ed;
  border: 1px solid #fdba74;
}
.closeout-panel-h {
  font-size: 13px;
  font-weight: 650;
  margin: 0 0 10px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.closeout-panel-h.is-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.closeout-panel-h .hint {
  font-weight: 400;
}
.closeout-panel-link {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.closeout-panel-link:hover {
  text-decoration: underline;
}
.closeout-chip-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.closeout-ok-fold {
  margin-top: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.closeout-ok-fold > summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.closeout-ok-fold > summary::-webkit-details-marker {
  display: none;
}
.closeout-ok-fold > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--muted);
  transition: transform 0.12s ease;
}
.closeout-ok-fold[open] > summary::before {
  transform: rotate(90deg);
}
.closeout-ok-fold .closeout-chip-grid {
  margin-top: 8px;
}
.closeout-chip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--card, #fff);
  border: 1px solid var(--line);
}
.closeout-chip.level-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.closeout-chip.level-warn {
  border-color: #fde68a;
  background: #fffbeb;
}
.closeout-chip.level-block {
  border-color: #fecaca;
  background: #fef2f2;
}
.closeout-chip-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.closeout-chip-text b {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.closeout-chip-text span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Delivery portal — shared type scale (list + detail) */
.delivery-page {
  --d-fs-title: 20px;
  --d-fs-section: 14px;
  --d-fs-body: 13px;
  --d-fs-meta: 12px;
  --d-fs-pill: 12px;
  font-size: var(--d-fs-body);
  line-height: 1.45;
  color: #0f172a;
}
.delivery-page-head h1,
.delivery-page > .page-head h1 {
  font-size: var(--d-fs-title);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  line-height: 1.3;
}
.delivery-page-head .ui-alert,
.delivery-page > .page-head .ui-alert {
  font-size: var(--d-fs-body);
  line-height: 1.45;
}
.delivery-hero,
.delivery-section {
  font-size: var(--d-fs-body);
  line-height: 1.45;
  color: #0f172a;
}
.delivery-section {
  margin-top: 12px;
}
.delivery-hero-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: flex-start;
  justify-content: space-between;
}
.delivery-hero-title {
  font-size: var(--d-fs-section);
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.delivery-hero-name {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.delivery-hero-name:hover {
  color: #0f766e;
  text-decoration: underline;
}
.delivery-hero-sep {
  font-weight: 400;
  color: #64748b;
}
.delivery-hero-meta {
  margin-top: 4px;
  font-size: var(--d-fs-meta);
}
.delivery-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  max-width: 28rem;
}
.delivery-dir-info {
  margin-top: 8px;
  font-size: var(--d-fs-meta);
}
.delivery-dir-info > summary {
  cursor: pointer;
  color: #64748b;
  font-weight: 600;
}
.delivery-dir-info-body {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #e8eef5;
  border-radius: 8px;
  background: #f8fafc;
}
.delivery-more-actions {
  position: relative;
}
.delivery-more-actions > summary {
  list-style: none;
  cursor: pointer;
  font-size: var(--d-fs-meta);
  font-weight: 600;
  color: #334155;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.delivery-more-actions > summary::-webkit-details-marker { display: none; }
.delivery-more-actions[open] > summary {
  border-color: #0f766e;
  color: #0f766e;
}
.delivery-more-actions-body {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 8;
  min-width: 11rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid #e8eef5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.delivery-zone {
  margin-top: 16px;
}
.delivery-zone-h {
  font-size: var(--d-fs-section);
  font-weight: 650;
  color: #0f172a;
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e8eef5;
}
.delivery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-top: 10px;
}
.delivery-section-h {
  font-size: var(--d-fs-section);
  font-weight: 650;
  margin: 0 0 8px;
  color: #0f172a;
}
.delivery-section-h .hint {
  font-size: var(--d-fs-meta);
  font-weight: 400;
}
.delivery-page .status-pill,
.delivery-page .delivery-gap-pill,
.delivery-page .closeout-chip .status-pill {
  font-size: var(--d-fs-pill);
}
.delivery-page .hint,
.delivery-page code {
  font-size: var(--d-fs-meta);
}
.delivery-list-job-main {
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
}
.delivery-list-job-main:hover {
  color: #0f766e;
  text-decoration: underline;
}
.delivery-list-job-meta {
  margin-top: 2px;
  font-size: var(--d-fs-meta);
  color: #64748b;
  line-height: 1.35;
}
.delivery-list-counts {
  font-size: var(--d-fs-body);
  line-height: 1.4;
  color: #334155;
}
.delivery-list-counts .muted {
  font-size: var(--d-fs-meta);
  color: #94a3b8;
}
.delivery-list-toolbar .delivery-list-date-sep {
  flex: 0 0 auto;
  line-height: var(--control-h);
  user-select: none;
}
.delivery-list-toolbar .delivery-list-clear-slot {
  display: inline-block;
  width: 4.5rem;
  height: var(--control-h);
  flex: 0 0 4.5rem;
  visibility: hidden;
  pointer-events: none;
}
.delivery-claim-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 22rem;
  overflow: auto;
}
.delivery-claim-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid #e8eef5;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  font-size: var(--d-fs-body, 13px);
}
.delivery-claim-row img {
  object-fit: cover;
  border-radius: 6px;
  background: #e2e8f0;
  flex: 0 0 auto;
}
.delivery-claim-meta {
  min-width: 0;
  flex: 1 1 auto;
}
.delivery-token-card {
  text-align: center;
}
.delivery-token-card img {
  display: block;
  margin: 0 auto 10px;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}
.delivery-token-url {
  word-break: break-all;
  font-size: var(--d-fs-meta, 12px);
  margin-bottom: 8px;
}

.admin-table-wrap > table.delivery-list-table {
  font-size: var(--d-fs-body);
}
.admin-table-wrap > table.delivery-list-table > thead > tr > th {
  font-size: var(--d-fs-meta);
  font-weight: 650;
}
.delivery-complete-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 960px) {
  .delivery-complete-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .delivery-complete-grid {
    grid-template-columns: 1fr;
  }
}
.delivery-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 960px) {
  .delivery-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .delivery-info-grid {
    grid-template-columns: 1fr;
  }
}
.delivery-info-card {
  border: 1px solid #e8eef5;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  min-width: 0;
}
.delivery-mini-h {
  font-size: 12px;
  font-weight: 650;
  color: #334155;
  margin: 0 0 6px;
}
.delivery-info-line {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  margin-bottom: 2px;
  word-break: break-word;
}
/* delivery catalog type chips use .seg / .seg-btn (see list-toolbar) */
.delivery-toc {
  margin-top: 12px;
  padding: 10px 14px;
  position: sticky;
  top: var(--app-topbar-h);
  z-index: 5;
  background: #fff;
  border: 1px solid #e8eef5;
}
/* Extra clearance for sticky TOC (html scroll-padding already covers topbar) */
.delivery-hero[id],
.delivery-section[id] {
  scroll-margin-top: 4.75rem;
}
.delivery-toc-label {
  font-size: 12px;
  font-weight: 650;
  color: #64748b;
  margin-bottom: 8px;
}
.delivery-toc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.delivery-toc-link {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.delivery-toc-link:hover {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
}
a.closeout-chip.delivery-chip-link {
  text-decoration: none;
  color: inherit;
  display: grid;
  cursor: pointer;
  align-items: center;
}
a.closeout-chip.delivery-chip-link:hover {
  box-shadow: 0 0 0 1px #0f766e inset;
}
a.closeout-chip.closeout-chip-link {
  display: grid;
}
.closeout-panel.closeout-jump-flash {
  box-shadow: 0 0 0 2px #0f766e inset;
  transition: box-shadow 0.2s ease;
}
.delivery-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  font-size: 13px;
  line-height: 1.45;
}
.delivery-kv > div > .hint {
  display: inline-block;
  margin: 0 0 2px;
  font-size: 13px;
}
/* Match surrounding body text; global code is 12px and looks a step smaller. */
.delivery-page code {
  font-size: 1em;
}
.delivery-kv-wide {
  grid-column: 1 / -1;
}
@media (max-width: 640px) {
  .delivery-kv {
    grid-template-columns: 1fr;
  }
}
.delivery-email-compact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: #0f172a;
}
.delivery-email-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}
.delivery-email-line > .hint {
  flex: 0 0 2.5rem;
  margin: 0;
  white-space: nowrap;
  font-size: 12px;
}
.delivery-email-value {
  min-width: 0;
  flex: 1 1 auto;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.45;
  color: #0f172a;
}
.delivery-email-value .delivery-file-name,
.delivery-email-value code {
  display: inline;
  margin-right: 8px;
  word-break: break-all;
  font-family: inherit;
  font-size: 1em;
}
/* Attachment / file display names: same face as surrounding body text */
.delivery-page .delivery-file-name,
.closeout-file-list .delivery-file-name,
.closeout-file-list code,
.admin-edit-att-list .delivery-file-name {
  font-family: inherit;
  font-size: inherit;
  word-break: break-all;
}
.delivery-email-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  align-items: baseline;
  font-size: 13px;
  line-height: 1.45;
  color: #0f172a;
}
.delivery-email-meta > span {
  white-space: nowrap;
}
.delivery-email-meta .hint {
  margin: 0 4px 0 0;
  font-size: 12px;
}
.delivery-gap-pill {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
/* Panel variant (dashed card). Inline toolbars use .file-upload-inline instead. */
.closeout-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0 0 10px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}
.closeout-upload.file-upload-inline,
.delivery-actions .closeout-upload,
.delivery-section-h .closeout-upload,
.closeout-upload.delivery-section-upload,
.delivery-section-h .file-upload-inline,
.file-upload-inline.delivery-section-upload {
  margin: 0;
  padding: 0;
  gap: 8px;
  flex-wrap: nowrap;
  background: transparent;
  border: none;
  border-radius: 0;
}
.closeout-upload input[type="file"]:not(.file-pick-input) {
  flex: 1 1 14rem;
  min-width: 0;
  max-width: 100%;
}
.closeout-upload.file-upload-inline input[type="file"]:not(.file-pick-input),
.delivery-actions .closeout-upload input[type="file"]:not(.file-pick-input),
.delivery-section-h .closeout-upload input[type="file"]:not(.file-pick-input),
.closeout-upload.delivery-section-upload input[type="file"]:not(.file-pick-input) {
  flex: 1 1 14rem;
  width: 14rem;
  min-width: 12rem;
  max-width: 20rem;
  height: var(--control-h-sm);
  min-height: var(--control-h-sm);
}
.closeout-upload.file-upload-inline input[type="file"]:not(.file-pick-input)::file-selector-button,
.closeout-upload.file-upload-inline input[type="file"]:not(.file-pick-input)::-webkit-file-upload-button,
.delivery-actions .closeout-upload input[type="file"]:not(.file-pick-input)::file-selector-button,
.delivery-actions .closeout-upload input[type="file"]:not(.file-pick-input)::-webkit-file-upload-button,
.delivery-section-h .closeout-upload input[type="file"]:not(.file-pick-input)::file-selector-button,
.delivery-section-h .closeout-upload input[type="file"]:not(.file-pick-input)::-webkit-file-upload-button,
.closeout-upload.delivery-section-upload input[type="file"]:not(.file-pick-input)::file-selector-button,
.closeout-upload.delivery-section-upload input[type="file"]:not(.file-pick-input)::-webkit-file-upload-button {
  height: calc(var(--control-h-sm) - 10px);
  line-height: calc(var(--control-h-sm) - 12px);
  padding: 0 10px;
  font-size: 12px;
}
.closeout-upload .btn-sm,
.file-upload-inline.delivery-section-upload > .btn-sm {
  align-self: center;
  margin: 0;
  flex: 0 0 auto;
}
.closeout-match {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.closeout-match.ok {
  background: #ecfdf5;
  color: #065f46;
}
.closeout-match.warn {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
}
.closeout-match.muted {
  background: #f1f5f9;
  color: #475569;
}
.closeout-match-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.closeout-match-grid-2 {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}
@media (max-width: 720px) {
  .closeout-match-grid,
  .closeout-match-grid-2 {
    grid-template-columns: 1fr;
  }
}
.closeout-mini-h {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 6px;
}
.closeout-file-list {
  margin: 0;
  padding-left: 1.2em;
  font-size: 12px;
  max-height: 140px;
  overflow: auto;
}
.closeout-file-list code,
.closeout-file-list .delivery-file-name,
.closeout-compact-table .delivery-file-name,
.closeout-compact-table code,
.closeout-compact-table .sn,
.closeout-path {
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-all;
}
.closeout-compact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.4;
}
.closeout-compact-table th,
.closeout-compact-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.closeout-compact-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--hover-bg-soft, #f8fafc);
  white-space: nowrap;
}
.closeout-compact-table tr:last-child td {
  border-bottom: none;
}
.closeout-compact-table .col-status {
  width: 5.5rem;
  white-space: nowrap;
}
.closeout-compact-wrap {
  max-height: 160px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.closeout-asset-table {
  font-size: 12px;
}
.closeout-asset-table th,
.closeout-asset-table td {
  padding: 5px 8px;
  font-size: 12px;
}
.closeout-root-hint {
  margin-top: 8px;
}
.closeout-root-hint .closeout-path {
  color: var(--muted);
}
.closeout-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.closeout-opt-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.closeout-opt-group-sep {
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.closeout-opt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 14px;
  row-gap: 2px;
  margin-left: 22px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}
.closeout-more-opts {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  flex: 0 0 auto;
  min-height: 20px;
}
.closeout-more-opts[open] {
  flex: 1 1 100%;
}
.closeout-more-opts > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  height: 20px;
  font-weight: 500;
  font-size: 12.5px;
  line-height: 20px;
  white-space: nowrap;
}
.closeout-more-opts > summary::before {
  flex: 0 0 auto;
  position: relative;
  top: 0;
}
.closeout-more-opts .project-detail-fold-body {
  margin-top: 6px;
}
.closeout-more-opts .closeout-opt-group {
  margin-top: 0;
}
.closeout-foot .msg {
  margin: 8px 0 0;
}
.closeout-foot .msg:empty {
  display: none;
  margin: 0;
}
.closeout-opt-children {
  display: contents;
}
.closeout-opt-children.is-disabled > .closeout-opt-child,
.closeout-opt-children.is-disabled > .closeout-opt-hint {
  opacity: 0.45;
  pointer-events: none;
}
.closeout-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  flex: 0 1 auto;
  max-width: 100%;
}
.closeout-opt-child {
  box-sizing: border-box;
  height: 20px;
  font-size: 12.5px;
  line-height: 20px;
  white-space: nowrap;
}
.closeout-opt input {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.closeout-opt-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}
@media (max-width: 720px) {
  .closeout-opt-row {
    margin-left: 14px;
  }
  .closeout-opt-child {
    white-space: normal;
  }
  .closeout-more-opts > summary {
    white-space: normal;
  }
}
.closeout-email {
  font-size: 13px;
}

@keyframes row-flash-bg {
  0%, 100% { background-color: transparent; }
  20%, 60% { background-color: #ECFDF5; }
}
tr.row-flash > td {
  animation: row-flash-bg 1.6s ease;
}

.progress-line {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-line > span {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #cbd5e1;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Collect progress UI */
/* Collect progress UI */
.collect-layout {
  align-items: start;
}
.collect-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.collect-progress .progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
}
.collect-progress .progress-meta-right {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.collect-progress .progress-meta #progressElapsed {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.collect-progress .progress-meta #progressPercent {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.collect-progress .progress-bar {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}
.collect-progress .progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 999px;
  transition: width .25s ease;
}
.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow: auto;
}
.step-item {
  position: relative;
  padding: 8px 10px 8px 28px;
  border-left: 2px solid var(--line);
  margin-left: 8px;
  font-size: 13px;
}
.step-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.step-item .step-title { font-weight: 600; }
.step-item .step-detail { color: var(--muted); margin-top: 2px; font-size: 12px; }
.step-item.ok { border-left-color: var(--ok); }
.step-item.ok::before { background: var(--ok); }
.step-item.warn { border-left-color: var(--warn); }
.step-item.warn::before { background: var(--warn); }
.step-item.active { border-left-color: var(--accent); background: rgba(16, 185, 129, 0.06); }
.step-item.active::before {
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}

.content-preview .preview-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}
.content-preview .preview-block {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.content-preview .preview-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: none;
  letter-spacing: 0;
}
.content-preview .muted,
.muted { color: var(--muted); }

/* Admin shell */
/* Admin shell (Slate + Emerald) */
.admin-body {
  --admin-side: #1B2433;
  --admin-side-2: #0F172A;
  --admin-rail: rgba(148, 163, 184, 0.14);
  --admin-ink: #F1F5F9;
  --admin-muted: #94A3B8;
  --admin-active: rgba(16, 185, 129, 0.16);
  --admin-active-ink: #ECFDF5;
  --admin-surface: #F8FAFC;
  --admin-panel: #FFFFFF;
  background: var(--admin-surface);
  min-height: 100vh;
  color: var(--text);
}
.admin-shell {
  display: grid;
  grid-template-columns: 224px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.2s ease;
}
.admin-shell.is-side-collapsed {
  grid-template-columns: 72px 1fr;
}
html.admin-side-collapsed-boot .admin-shell {
  grid-template-columns: 72px 1fr;
}
.admin-side {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.45) 0%, transparent 32%),
    linear-gradient(180deg, var(--admin-side) 0%, var(--admin-side-2) 100%);
  color: var(--admin-ink);
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid rgba(15, 23, 42, 0.55);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
  overflow: visible;
  transition: padding 0.2s ease;
}
.admin-side-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--admin-rail);
  flex: 0 0 auto;
}
.admin-side-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 32px;
  height: 32px;
  margin: 0;
  margin-left: auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #94A3B8;
  cursor: pointer;
  font: inherit;
  font-size: 0;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.admin-side-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #F8FAFC;
  border-color: rgba(255, 255, 255, 0.1);
}
.admin-side-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.admin-side-toggle-ico {
  display: block;
  transition: transform 0.2s ease;
}
.admin-shell.is-side-collapsed .admin-side-toggle-ico,
html.admin-side-collapsed-boot .admin-side-toggle-ico {
  transform: rotate(180deg);
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border-bottom: 0;
  min-width: 0;
  flex: 1 1 auto;
}
.admin-side-top .admin-brand {
  border-bottom: 0;
  padding: 0;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
.admin-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(145deg, var(--accent-soft), var(--accent));
  box-shadow: none;
  flex: 0 0 auto;
}
.admin-brand-text {
  min-width: 0;
}
.admin-brand-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}
.admin-brand-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--admin-muted);
}
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 4px 2px 6px;
  margin: 0;
  /* Overlay-like thin rail; stay invisible until hover */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.admin-side:hover .admin-nav,
.admin-nav:focus-within {
  scrollbar-color: rgba(100, 116, 139, 0.55) transparent;
}
.admin-nav::-webkit-scrollbar {
  width: 4px;
}
.admin-nav::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}
.admin-nav::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
.admin-side:hover .admin-nav::-webkit-scrollbar-thumb,
.admin-nav:focus-within::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.45);
}
.admin-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
}
.admin-nav::-webkit-scrollbar-corner {
  background: transparent;
}
.admin-nav-label {
  margin: 12px 10px 4px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748B;
}
.admin-nav-label:first-child { margin-top: 2px; }
.admin-nav-advanced {
  margin-top: 6px;
}
.admin-nav-advanced > summary.admin-nav-advanced-sum {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.admin-nav-advanced > summary.admin-nav-advanced-sum::-webkit-details-marker {
  display: none;
}
.admin-nav-advanced > summary.admin-nav-advanced-sum::after {
  content: "▾";
  float: right;
  opacity: 0.55;
  font-size: 10px;
}
.admin-nav-advanced[open] > summary.admin-nav-advanced-sum::after {
  content: "▴";
}
.admin-nav-advanced > a {
  margin-top: 2px;
}
.admin-nav a,
.admin-nav .admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  color: #94A3B8;
  padding: 7px 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}
.admin-nav a:hover,
.admin-nav .admin-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #F8FAFC;
  text-decoration: none;
}
.admin-nav a.active {
  background: var(--admin-active);
  color: var(--admin-active-ink);
  font-weight: 600;
  box-shadow: inset 2px 0 0 0 #34D399;
}
.admin-nav a.active:hover {
  background: var(--admin-active);
  color: var(--admin-active-ink);
}
.admin-nav-ico,
.admin-nav svg {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  flex: 0 0 18px;
  display: block;
  overflow: visible;
  opacity: 0.9;
}
.admin-nav-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}
.admin-nav-ext {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.admin-side-close {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #E2E8F0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.admin-side-scrim {
  display: none;
}
.admin-side-scrim[hidden] {
  display: none !important;
}
.admin-menu-toggle {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 0;
  margin-right: auto;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  cursor: pointer;
  flex: 0 0 auto;
}
.admin-menu-toggle:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.admin-side-foot {
  border-top: 1px solid var(--admin-rail);
  padding: 10px 2px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
  position: relative;
  z-index: 50;
}
.admin-user-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}
.admin-side-notify {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  min-width: 0;
}
.admin-side-notify .notify-wrap {
  flex: 0 0 auto;
}
.admin-side-notify .notify-bell {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border-color: transparent;
  color: #CBD5E1;
  background: transparent;
}
.admin-side-notify .notify-bell:hover,
.admin-side-notify .notify-bell[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
  color: #F8FAFC;
}
.admin-side-notify .notify-panel {
  top: auto;
  bottom: 0;
  left: calc(100% + 12px);
  right: auto;
}
.admin-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
  min-width: 0;
  flex: 1 1 auto;
  border-radius: 8px;
  background: transparent;
}
.admin-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #ECFDF5;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(52, 211, 153, 0.28);
  flex: 0 0 auto;
}
.admin-user-meta {
  min-width: 0;
  flex: 1 1 auto;
}
.admin-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #F8FAFC;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-user-role {
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--admin-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-logout .admin-btn-block,
.admin-side-foot .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.admin-foot-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.admin-foot-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  margin: 0;
  padding: 6px 2px 5px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94A3B8;
  font: inherit;
  font-size: 10px;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.admin-foot-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #F8FAFC;
  text-decoration: none;
}
.admin-logout {
  margin: 0;
  min-width: 0;
}
.admin-logout-ico,
.admin-back-ico,
.admin-foot-btn svg.btn-ico {
  width: 15px;
  height: 15px;
  max-width: 15px;
  max-height: 15px;
  display: block;
  flex: 0 0 15px;
}
.admin-logout-text,
.admin-back-text {
  min-width: 0;
}

/* Collapsed rail */
.admin-shell.is-side-collapsed .admin-side,
html.admin-side-collapsed-boot .admin-side {
  padding: 12px 8px 10px;
  align-items: center;
}
.admin-shell.is-side-collapsed .admin-side-top,
html.admin-side-collapsed-boot .admin-side-top {
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding-bottom: 8px;
}
.admin-shell.is-side-collapsed .admin-brand,
html.admin-side-collapsed-boot .admin-brand {
  justify-content: center;
  padding: 0;
  width: 100%;
  flex: 0 0 auto;
}
.admin-shell.is-side-collapsed .admin-brand-text,
.admin-shell.is-side-collapsed .admin-nav-label,
.admin-shell.is-side-collapsed .admin-nav-text,
.admin-shell.is-side-collapsed .admin-nav-ext,
.admin-shell.is-side-collapsed .admin-user-meta,
.admin-shell.is-side-collapsed .admin-logout-text,
.admin-shell.is-side-collapsed .admin-back-text,
.admin-shell.is-side-collapsed .admin-nav-advanced > summary.admin-nav-advanced-sum,
html.admin-side-collapsed-boot .admin-brand-text,
html.admin-side-collapsed-boot .admin-nav-label,
html.admin-side-collapsed-boot .admin-nav-text,
html.admin-side-collapsed-boot .admin-nav-ext,
html.admin-side-collapsed-boot .admin-user-meta,
html.admin-side-collapsed-boot .admin-logout-text,
html.admin-side-collapsed-boot .admin-back-text,
html.admin-side-collapsed-boot .admin-nav-advanced > summary.admin-nav-advanced-sum {
  display: none !important;
}
.admin-shell.is-side-collapsed .admin-nav-advanced,
html.admin-side-collapsed-boot .admin-nav-advanced {
  margin-top: 2px;
}
.admin-shell.is-side-collapsed .admin-nav-advanced[open],
html.admin-side-collapsed-boot .admin-nav-advanced[open] {
  display: contents;
}
.admin-shell.is-side-collapsed .admin-side-toggle,
html.admin-side-collapsed-boot .admin-side-toggle {
  width: 36px;
  height: 32px;
  padding: 0;
  margin: 0;
}
.admin-shell.is-side-collapsed .admin-nav,
html.admin-side-collapsed-boot .admin-nav {
  width: 100%;
  align-items: center;
  padding: 2px 0;
}
.admin-shell.is-side-collapsed .admin-nav a,
.admin-shell.is-side-collapsed .admin-nav .admin-nav-btn,
html.admin-side-collapsed-boot .admin-nav a,
html.admin-side-collapsed-boot .admin-nav .admin-nav-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  gap: 0;
}
.admin-shell.is-side-collapsed .admin-user-row,
html.admin-side-collapsed-boot .admin-user-row {
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
  width: 100%;
}
.admin-shell.is-side-collapsed .admin-side-notify,
html.admin-side-collapsed-boot .admin-side-notify {
  justify-content: center;
  padding: 0;
}
.admin-shell.is-side-collapsed .admin-side-notify .notify-panel,
html.admin-side-collapsed-boot .admin-side-notify .notify-panel {
  left: calc(100% + 12px);
  bottom: 0;
  top: auto;
  right: auto;
}
.admin-shell.is-side-collapsed .admin-nav a.active,
html.admin-side-collapsed-boot .admin-nav a.active {
  box-shadow: none;
}
.admin-shell.is-side-collapsed .admin-side-foot,
html.admin-side-collapsed-boot .admin-side-foot {
  width: 100%;
  align-items: center;
}
.admin-shell.is-side-collapsed .admin-user,
html.admin-side-collapsed-boot .admin-user {
  justify-content: center;
  padding: 0;
  width: auto;
  flex: 0 0 auto;
}
.admin-shell.is-side-collapsed .admin-logout,
html.admin-side-collapsed-boot .admin-logout {
  width: auto;
}
.admin-shell.is-side-collapsed .admin-foot-actions,
html.admin-side-collapsed-boot .admin-foot-actions {
  grid-template-columns: 1fr;
  width: 100%;
  gap: 2px;
  padding: 2px;
}
.admin-shell.is-side-collapsed .admin-foot-btn,
html.admin-side-collapsed-boot .admin-foot-btn {
  width: 36px;
  height: 32px;
  padding: 0;
  margin: 0 auto;
  flex-direction: row;
}
.admin-shell.is-side-collapsed .admin-logout-ico,
.admin-shell.is-side-collapsed .admin-back-ico,
html.admin-side-collapsed-boot .admin-logout-ico,
html.admin-side-collapsed-boot .admin-back-ico {
  display: block;
}

.admin-btn-block {
  width: 100%;
  margin-top: 0 !important;
}
.admin-side-foot .btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #E2E8F0;
  border-color: rgba(255, 255, 255, 0.14);
}
.admin-side-foot .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.admin-content {
  min-width: 0;
  background: var(--admin-surface);
}
.admin-main {
  padding: 28px 32px 56px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* Page chrome */
.admin-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.admin-page-head h1 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.admin-page-head .sub {
  margin: 0;
  max-width: 720px;
}
.admin-page-head .ui-alert {
  margin-top: 10px;
  margin-bottom: 0;
  max-width: 880px;
}

.admin-help-fold,
.page-help-fold {
  margin-top: 8px;
  max-width: 880px;
}
.admin-help-fold > summary,
.page-help-fold > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.admin-help-fold > summary::-webkit-details-marker,
.page-help-fold > summary::-webkit-details-marker {
  display: none;
}
.admin-help-fold > summary::before,
.page-help-fold > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid var(--muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.12s ease;
}
.admin-help-fold[open] > summary::before,
.page-help-fold[open] > summary::before {
  transform: rotate(90deg);
}
.admin-help-fold[open] > summary,
.page-help-fold[open] > summary {
  margin-bottom: 0;
}
.admin-help-fold > .ui-alert,
.page-help-fold > .ui-alert {
  margin-top: 8px;
  margin-bottom: 0;
  max-width: none;
}

.ui-alert-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.ui-alert-list > li {
  position: relative;
  padding-left: 12px;
  line-height: 1.45;
}
.ui-alert-list > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}
.ui-alert-list a {
  font-weight: 500;
}
.ui-alert-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

/* Align table text with card titles (cancel cell inset on edges) */
.admin-body .admin-table-wrap > table > thead > tr > th:first-child,
.admin-body .admin-table-wrap > table > tbody > tr > td:first-child {
  padding-left: 0;
}
.admin-body .admin-table-wrap > table > thead > tr > th:last-child,
.admin-body .admin-table-wrap > table > tbody > tr > td:last-child {
  padding-right: 0;
}
.admin-body .list-toolbar,
.admin-body .toolbar {
  margin-bottom: 14px;
}
.admin-body td.table-actions,
#snapTable td:last-child {
  white-space: nowrap;
  width: 1%;
  vertical-align: middle;
}
#snapTable td:last-child .table-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
#snapTable td:last-child .table-action,
#snapTable td:last-child a.table-action {
  display: inline;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}
.admin-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}

/* Stats */
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.admin-stat {
  background: var(--admin-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  min-width: 0;
}
a.admin-stat,
button.admin-stat {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  background: var(--admin-panel);
}
a.admin-stat:hover,
button.admin-stat:hover {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  text-decoration: none;
  color: inherit;
}
/* Reset global button chrome so stat cards match <a.admin-stat> */
button.admin-stat {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  color: inherit;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  transform: none;
}
button.admin-stat:hover:not(:disabled),
button.admin-stat:active:not(:disabled) {
  background: var(--admin-panel);
  color: inherit;
  transform: none;
}
a.admin-stat.is-active {
  border-color: rgba(16, 185, 129, 0.55);
  background: #F0FDF4;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2), 0 10px 24px rgba(15, 23, 42, 0.04);
}
.admin-stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.admin-stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.admin-stat.warn .admin-stat-value { color: var(--warn); }
.admin-stat.accent .admin-stat-value { color: var(--accent); }
.admin-stat.ok .admin-stat-value { color: #059669; }
.admin-stat.danger .admin-stat-value { color: #dc2626; }

.closeout-board-grid { margin-top: 4px; }
.closeout-board-list { margin-top: 12px; }
.closeout-board-list:first-of-type { margin-top: 0; }
.closeout-board-h {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}
.closeout-board-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.closeout-board-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.project-pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  max-width: 280px;
  line-height: 1.35;
}
.project-pipeline--compact {
  flex-wrap: nowrap;
  max-width: none;
  gap: 6px;
}
.pipe-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}
.pipe-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e5e7eb;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.pipe-dot.is-done {
  background: #64748b;
}
.pipe-dot.tone-ok.is-done {
  background: #059669;
}
.pipe-dot.tone-warn.is-done {
  background: var(--warn);
}
.pipe-dot.tone-block {
  background: #dc2626;
}
.pipe-step {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.pipe-step.is-done {
  color: var(--text);
  font-weight: 600;
}
.pipe-step.tone-ok.is-done { color: #059669; }
.pipe-step.tone-warn.is-done { color: var(--warn); }
.pipe-step.tone-block { color: #dc2626; font-weight: 600; }
.pipe-sep {
  color: #cbd5e1;
  font-size: 10px;
}

.result-ico-warn {
  color: var(--warn);
  background: rgba(245, 158, 11, 0.12);
}

/* Shipping-master sync stats: grouped rows, even card widths */
.sm-stat-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
  margin-bottom: 4px;
}
.sm-stat-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 6px;
}
.sm-stat-groups .admin-stat-grid,
.sm-stat-grid {
  margin-bottom: 0;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.sm-stat-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.sm-stat-groups .admin-stat {
  padding: 12px 14px;
}
.sm-stat-groups .admin-stat-label {
  margin-bottom: 6px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-stat-groups .admin-stat-value {
  font-size: 1.5rem;
}
@media (max-width: 960px) {
  .sm-stat-groups .admin-stat-grid,
  .sm-stat-grid,
  .sm-stat-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .sm-stat-groups .admin-stat-grid,
  .sm-stat-grid,
  .sm-stat-grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .sm-stat-groups .admin-stat-label {
    white-space: normal;
  }
}

/* Collapsible admin panels (e.g. retention policy) */
.admin-fold {
  padding: 0;
  overflow: hidden;
}
.admin-fold-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.admin-fold-summary::-webkit-details-marker { display: none; }
.admin-fold-summary::before {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-right: -4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  align-self: center;
}
.admin-fold[open] > .admin-fold-summary::before {
  transform: rotate(45deg);
  margin-top: -2px;
}
.admin-fold-main {
  min-width: 0;
  flex: 1;
}
.admin-fold-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.admin-fold-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-fold-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.admin-fold-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}
.admin-fold-toolbar {
  padding-top: 12px;
  margin-bottom: 4px;
}
.admin-fold-toolbar .sub {
  margin: 0;
}

/* Delivery migrate — one-click ops */
.migrate-ops {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.migrate-ops-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.migrate-ops-head .muted {
  margin: 6px 0 0;
  max-width: 72ch;
  line-height: 1.5;
  font-size: 13px;
}
.migrate-ops-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.migrate-ops-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  background: #f8fafc;
}
.migrate-ops-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.migrate-ops-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.migrate-ops-btns .btn {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
  justify-content: center;
}
.migrate-ops-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.migrate-ops-log-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.migrate-ops-log-body,
.migrate-ops .admin-code-block {
  margin: 0;
  min-height: 4.5rem;
  max-height: 18rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 10px 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12.5px;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (max-width: 1100px) {
  .migrate-ops-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .migrate-ops-groups {
    grid-template-columns: 1fr;
  }
  .migrate-ops-btns .btn {
    flex: 1 1 100%;
  }
}

/* Stacked full-width admin sections */
.admin-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 24px;
  align-items: start;
}
.admin-form-grid > div,
.admin-form-grid .admin-field {
  min-width: 0;
}
.admin-form-grid label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--label, #374151);
}
.admin-form-grid input,
.admin-form-grid select,
.admin-form-grid textarea {
  display: block;
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: var(--control-h, 38px);
}
/* Receiving-attrs create/edit: force visible text controls (avoid 0-size / transparent look) */
.recv-attrs-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.recv-attrs-form .admin-field {
  display: block;
}
.recv-attrs-form input[type="text"],
.recv-attrs-form input:not([type]),
.recv-attrs-form select,
.recv-attrs-form textarea {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  min-width: 160px !important;
  min-height: 40px !important;
  height: auto !important;
  border: 1px solid #CBD5E1 !important;
  background: #fff !important;
  color: #111827 !important;
  box-shadow: none !important;
}
.recv-attrs-form textarea {
  min-height: 88px !important;
}
@media (max-width: 960px) {
  .admin-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .admin-form-grid,
  .recv-attrs-form { grid-template-columns: 1fr; }
}

/* Panels / forms / tables inside admin */
.admin-body .card {
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}
/* Page panel titles only — dialog titles use .dlg-title / --dlg-title-* */
.admin-body .card > h2:not(.dlg-title) {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.admin-panel-head h2 { margin: 0; }
.admin-panel-head .sub { margin: 4px 0 0; font-size: 12px; }
.admin-form-stack label { margin-top: 12px; }
.admin-form-stack label:first-child { margin-top: 0; }
.admin-form-stack button,
.admin-form-stack .btn { margin-top: 16px; }
.admin-form-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.admin-form-section h2 { margin-bottom: 4px; }
.admin-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.admin-table-wrap > table {
  width: 100%;
  max-width: 100%;
}

/* Project list: clamp long cells; sticky ?? / ?? / ?? while scrolling */
#projectTable .cell-clamp {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  cursor: default;
}
#projectTable .cell-clamp.cell-customer {
  max-width: 100%;
}
#projectTable .cell-clamp.cell-sales {
  max-width: 100%;
}
#projectTable .cell-clamp.cell-logistics {
  max-width: 100%;
  color: var(--muted);
}
th.col-index,
td.col-index {
  width: 1%;
  min-width: 2.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 500;
}
/* 操作列固定宽：编辑/移除/交付/结项统一按钮（仅勾选列 + 操作列 sticky） */
#projectTable {
  --project-actions-sticky-w: 19rem;
}
#projectTable > thead > tr > th:first-child,
#projectTable > tbody > tr > td:first-child,
#projectTable > thead > tr > th:last-child,
#projectTable > tbody > tr > td:last-child {
  position: sticky;
  z-index: 2;
  background: var(--card);
}
#projectTable > thead > tr > th:first-child,
#projectTable > thead > tr > th:last-child {
  background: #F9FAFB;
  z-index: 3;
}
#projectTable > thead > tr > th:first-child,
#projectTable > tbody > tr > td:first-child {
  left: 0;
  box-shadow: 6px 0 8px -6px rgba(15, 23, 42, 0.12);
}
#projectTable > thead > tr > th:last-child,
#projectTable > tbody > tr > td:last-child {
  right: 0;
  z-index: 4;
  box-shadow: -6px 0 8px -6px rgba(15, 23, 42, 0.12);
}
#projectTable > thead > tr > th:last-child {
  z-index: 5;
}
#projectTable > tbody > tr:hover > td:first-child,
#projectTable > tbody > tr:hover > td:last-child {
  background: var(--hover-bg-soft);
}
/* td 保持 table-cell（避免 sticky 错位）；内部 flex 让操作按钮靠右 */
#projectTable td.table-actions {
  display: table-cell;
  vertical-align: middle;
  white-space: nowrap;
  margin: 0;
  overflow: hidden;
  padding-left: 8px;
  padding-right: 10px;
  text-align: right;
}
#projectTable td.table-actions .project-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  box-sizing: border-box;
}
#projectTable td.table-actions .project-actions-btns {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 4px;
}
#projectTable td.table-actions .btn-sm {
  padding: 2px 7px;
  font-size: 12px;
}
#projectTable .project-job-meta {
  margin-top: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-body table {
  font-size: 13px;
}
.admin-body thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #F9FAFB;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6B7280;
}
.admin-body td {
  padding: 12px 16px;
  vertical-align: middle;
}
.admin-body tbody tr:hover td {
  background: var(--hover-bg-soft);
}
.admin-body .list-toolbar input,
.admin-body .list-toolbar select,
.admin-body .toolbar input,
.admin-body .toolbar select {
  background: #fff;
}
/* snap-filter-bar / snap-filter-main: aliased to list-toolbar above */
.snap-serial-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px 0 10px;
  border-radius: 999px;
  background: var(--hover-bg);
  border: 1px solid #A7F3D0;
  color: var(--accent2);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  max-width: 100%;
}
.snap-serial-chip:hover {
  background: #D1FAE5;
  color: var(--accent2);
  text-decoration: none;
}
.snap-serial-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(4, 120, 87, 0.12);
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}
.admin-body .btn-secondary {
  margin-top: 0;
  padding: 7px 11px;
  font-size: 12.5px;
  border-radius: 8px;
}
.admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.admin-quick-grid .btn-link {
  text-align: center;
  margin: 0;
}
.admin-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.admin-group-row td {
  background: var(--bg-soft, #f8fafc);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding-top: 10px;
  padding-bottom: 8px;
  border-bottom-color: transparent;
}
.tax-ord {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 2.75rem;
}
.tax-ord-n {
  min-width: 1.25rem;
  text-align: right;
}
#sceneTable > thead > tr > th.col-drag,
#sceneTable > tbody > tr > td.col-drag,
#viewTable > thead > tr > th.col-drag,
#viewTable > tbody > tr > td.col-drag {
  width: 2.25rem;
  min-width: 2.25rem;
  padding-left: 4px;
  padding-right: 0;
  text-align: center;
  color: #64748b;
  vertical-align: middle;
}
.tax-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #64748b;
  background: #f1f5f9;
  cursor: grab;
  touch-action: none;
  user-select: none;
  flex-shrink: 0;
}
.tax-drag-handle svg {
  display: block;
  width: 16px;
  height: 16px;
}
.tax-drag-handle:hover,
.tax-drag-handle:focus-visible {
  color: #0f172a;
  background: #e2e8f0;
  outline: none;
}
tr.is-dragging {
  opacity: 0.45;
}
tr.is-dragging .tax-drag-handle {
  cursor: grabbing;
}

/* ?? Login page (split-screen, Slate + Emerald) ?? */
.login-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: #0F172A;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(320px, 1fr);
}

.login-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 48px 44px 56px;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(16, 185, 129, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(5, 150, 105, 0.16), transparent 50%),
    linear-gradient(165deg, #1E293B 0%, #0F172A 55%, #020617 100%);
  color: #F1F5F9;
}

.login-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-hero-grid {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.login-orbit {
  transform-origin: 300px 360px;
}

.login-orbit-a {
  animation: loginOrbit 28s linear infinite;
}

.login-orbit-b {
  animation: loginPulse 6s ease-in-out infinite;
}

.login-node {
  animation: loginNode 3.6s ease-in-out infinite;
  transform-origin: center;
}

.login-node-delay {
  animation-delay: 1.2s;
}

@keyframes loginOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes loginPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.75; }
}

@keyframes loginNode {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.login-hero-content {
  position: relative;
  z-index: 1;
  max-width: 420px;
}

.login-hero-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #A7F3D0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.login-hero-title {
  margin: 18px 0 10px;
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #F8FAFC;
}

.login-hero-desc {
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.6;
  color: #94A3B8;
}

.login-hero-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.login-hero-points li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  color: #CBD5E1;
}

.login-hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.login-main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 28px 72px;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(16, 185, 129, 0.06), transparent 55%),
    #F1F5F9;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 32px 28px 28px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 32px rgba(15, 23, 42, 0.06);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-brand-mark {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(145deg, #10B981, #059669);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.28);
}

.login-brand-text h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
  line-height: 1.2;
}

.login-brand-text p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #4B5563;
  line-height: 1.4;
}

.login-alert {
  margin: 0 0 16px;
  font-size: 13px;
}

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

.login-field label {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.login-input {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 12px;
  display: inline-flex;
  color: #9CA3AF;
  pointer-events: none;
  transition: color 0.15s ease;
}

.login-input input {
  width: 100%;
  height: 40px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 0 42px 0 40px;
  font-size: 14px;
  line-height: 40px;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input input::placeholder {
  color: #9CA3AF;
}

.login-input input:hover {
  border-color: #D1D5DB;
}

.login-input:focus-within .login-input-icon {
  color: #059669;
}

.login-input input:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.login-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9CA3AF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
}

.login-eye:hover {
  background: #F3F4F6;
  color: #4B5563;
  box-shadow: none;
}

.login-eye:active {
  transform: translateY(-50%);
}

.login-eye:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
  color: #059669;
}

.login-submit {
  margin-top: 4px;
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: #059669;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
}

.login-submit:hover:not(:disabled) {
  background: #047857;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.28);
}

.login-submit:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.22);
}

.login-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.28);
}

.login-pass-hint {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.45;
  color: #64748b;
}

.admin-topbar-scan {
  display: none;
}

.mobile-entry-qr-dlg {
  width: min(360px, 92vw);
  max-width: min(360px, 92vw);
}
.mobile-entry-qr-card {
  margin: 0;
  padding: var(--dlg-pad);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--dlg-radius);
  box-shadow: var(--dlg-shadow);
}
.mobile-entry-qr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.mobile-entry-qr-head h2,
.mobile-entry-qr-head .dlg-title,
.mobile-entry-qr-head strong {
  margin: 0;
  font-size: var(--dlg-title-size);
  font-weight: var(--dlg-title-weight);
  letter-spacing: -0.01em;
  color: var(--text);
}
.mobile-entry-qr-hint {
  margin: 0 0 10px;
}
.mobile-entry-qr-body {
  text-align: center;
  margin: 12px 0;
}
.mobile-entry-qr-body img {
  display: block;
  margin: 0 auto 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
}
.mobile-entry-qr-url {
  display: block;
  font-size: 12px;
  word-break: break-all;
  color: var(--muted);
  line-height: 1.45;
}
.mobile-entry-qr-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.mobile-entry-qr-actions > button,
.mobile-entry-qr-actions > .btn,
.mobile-entry-qr-actions > a {
  margin-top: 0;
}

.login-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: #9CA3AF;
}

.login-hint-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #9CA3AF;
  display: inline-flex;
}

.login-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  text-align: center;
  font-size: 12px;
  color: #9CA3AF;
  letter-spacing: 0.01em;
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: 220px;
    padding: 32px 24px 36px;
    align-items: flex-end;
  }

  .login-hero-points {
    display: none;
  }

  .login-hero-title {
    font-size: 26px;
  }

  .login-hero-desc {
    margin-bottom: 0;
  }

  .login-main {
    padding: 28px 20px 64px;
    min-height: calc(100vh - 220px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-orbit-a,
  .login-orbit-b,
  .login-node,
  .login-node-delay {
    animation: none;
  }
}
button.btn-secondary,
.btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #D1D5DB;
  border-radius: var(--radius);
  padding: 0 12px;
  height: var(--control-h);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}
button.btn-secondary:hover,
.btn-secondary:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
  color: #111827;
}
a.btn-link,
button.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-h-sm);
  min-height: var(--control-h-sm);
  padding: 0 12px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  text-decoration: none !important;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}
a.btn-link:hover,
button.btn-link:hover {
  background: var(--hover-bg);
  border-color: var(--hover-line);
  color: var(--accent2);
  text-decoration: none !important;
}
/* ?? Shared <dialog> shell + form dialogs ?? */
dialog {
  border: none;
  border-radius: var(--dlg-radius);
  padding: 0;
  max-width: 98vw;
  overflow: visible;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}
dialog::backdrop {
  background: var(--dlg-backdrop);
  backdrop-filter: blur(2px);
}

/* Shared title / actions used across dialog cards */
.dlg-title {
  margin: 0 0 6px;
  font-size: var(--dlg-title-size);
  font-weight: var(--dlg-title-weight);
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
}
.dlg-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.dlg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.dlg-actions > button,
.dlg-actions > .btn,
.dlg-actions > a {
  margin-top: 0;
}
.dlg-actions > button:not(.btn-sm):not(.table-action),
.dlg-actions > .btn:not(.btn-sm) {
  min-width: 84px;
}
.dlg-actions-start {
  margin-right: auto;
}

/* Admin edit form dialogs (客户 / 作业 / 资产 / 用户 / …) */
.admin-edit-dlg {
  max-width: 98vw;
}
.admin-edit-card {
  box-shadow: var(--dlg-shadow);
  width: min(520px, 94vw);
  max-width: 96vw;
  margin: 0;
  padding: var(--dlg-pad);
}
.admin-edit-card--wide {
  width: var(--admin-workflow-dlg-w);
}
.admin-edit-card--1200 {
  width: min(1200px, 96vw);
  max-width: 96vw;
}
.admin-edit-card--1200 .admin-form-grid label {
  display: block;
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.admin-edit-card--1200 .admin-form-grid input {
  width: 100%;
  box-sizing: border-box;
}
.admin-edit-card--xl {
  width: min(1440px, 98vw);
  max-width: 98vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}
/* Tall edit forms: sticky head/foot (作业编辑等) */
.admin-edit-card--sticky {
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  overflow: hidden;
}
.admin-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.admin-edit-head .dlg-title {
  margin: 0;
}
.admin-edit-head .dlg-sub {
  margin-top: 4px;
}
.admin-edit-card--sticky > .admin-edit-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 12px 2px 4px 0;
}
.admin-edit-foot {
  flex: 0 0 auto;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.admin-edit-foot .msg {
  margin: 0 0 8px;
}
.admin-edit-foot .msg:empty {
  display: none;
  margin: 0;
}
.admin-edit-foot .dlg-actions {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.admin-edit-sec {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 10px;
  background: var(--card, #fff);
}
.admin-edit-sec:last-child {
  margin-bottom: 0;
}
.admin-edit-sec > .project-detail-h,
.admin-edit-sec > .admin-edit-sec-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
}
.admin-edit-sec .admin-form-grid {
  margin-top: 0;
}
.admin-edit-sec .admin-form-grid label {
  display: block;
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.admin-edit-attach-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.admin-edit-attach-tools input[type="file"] {
  max-width: 100%;
}
.admin-edit-att-list {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}
.admin-edit-att-list ul {
  margin: 6px 0 0;
  padding-left: 1.1rem;
}
.admin-edit-att-list li {
  margin: 2px 0;
  word-break: break-word;
}
.admin-edit-card > h2,
.admin-edit-card .dlg-title,
.admin-body .admin-edit-card > h2,
.admin-body .admin-edit-card .dlg-title {
  margin: 0 0 12px;
  font-size: var(--dlg-title-size);
  font-weight: var(--dlg-title-weight);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.admin-edit-card--sticky > .admin-edit-head .dlg-title {
  margin: 0;
}
.admin-edit-body {
  max-height: 70vh;
  overflow: auto;
}
.admin-edit-card .dlg-actions {
  margin-top: 14px;
}
.admin-edit-card .msg {
  margin-top: 8px;
}
.admin-edit-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 50vh;
  overflow: auto;
}

/* Shipping email viewer (wide dialog) */
.sm-email-dlg {
  max-width: 98vw;
}
.sm-email-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.sm-email-head-main {
  min-width: 0;
  flex: 1;
}
.sm-email-head .dlg-title {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-email-head .dlg-sub {
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-email-head-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}
.sm-email-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 10px 14px 14px;
}

/* Shared confirm / alert modal */
.ui-confirm-dlg {
  width: min(420px, 92vw);
}
.ui-confirm-card {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 14px;
  padding: var(--dlg-pad);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--dlg-radius);
  box-shadow: var(--dlg-shadow);
}
.ui-confirm-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--accent);
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
}
.ui-confirm-icon.is-warn {
  color: #B45309;
  background: #FFFBEB;
  border-color: #FDE68A;
}
.ui-confirm-icon.is-danger {
  color: #B91C1C;
  background: #FEF2F2;
  border-color: #FECACA;
}
.ui-confirm-icon.is-ok {
  color: #047857;
  background: #ECFDF5;
  border-color: #A7F3D0;
}
.ui-confirm-body {
  min-width: 0;
  grid-column: 2;
}
.ui-confirm-title {
  margin: 2px 0 6px;
  font-size: var(--dlg-title-size);
  font-weight: var(--dlg-title-weight);
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.ui-confirm-msg {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-line;
}
.ui-confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.ui-confirm-actions button {
  margin-top: 0;
  min-width: 84px;
  gap: 6px;
}
.ui-confirm-actions button svg.btn-ico {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  display: block;
}
.ui-confirm-ok.danger,
button.ui-confirm-ok.danger {
  background: #DC2626;
  border-color: #DC2626;
  color: #fff;
}
.ui-confirm-ok.danger:hover:not(:disabled),
button.ui-confirm-ok.danger:hover:not(:disabled),
button.ui-confirm-ok.danger:focus-visible {
  background: #B91C1C;
  border-color: #B91C1C;
  color: #fff;
}
.ui-confirm-actions.keep-latest-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.ui-confirm-actions.keep-latest-actions button {
  margin-top: 0;
  min-width: auto;
}
.ui-confirm-actions button.danger,
.keep-latest-actions button[value="purge"] {
  background: #DC2626;
  border-color: #DC2626;
  color: #fff;
}
.ui-confirm-actions button.danger:hover:not(:disabled),
.keep-latest-actions button[value="purge"]:hover:not(:disabled),
.ui-confirm-actions button.danger:focus-visible,
.keep-latest-actions button[value="purge"]:focus-visible {
  background: #B91C1C;
  border-color: #B91C1C;
  color: #fff;
}
.keep-latest-dlg {
  width: min(720px, 94vw);
}
.keep-latest-card {
  grid-template-columns: auto 1fr;
}
.keep-latest-card .ui-confirm-body {
  grid-column: 2;
}
.keep-latest-preview {
  margin-top: 12px;
  max-height: min(42vh, 360px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #F8FAFC;
  padding: 8px 10px;
}
.keep-latest-group + .keep-latest-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.keep-latest-sn {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text);
}
.keep-latest-label {
  font-size: 12px;
  font-weight: 600;
  margin: 6px 0 4px;
}
.keep-latest-label.keep { color: #047857; }
.keep-latest-label.affect { color: #B45309; }
.keep-latest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.keep-latest-list li {
  display: grid;
  grid-template-columns: minmax(9.5rem, 1.2fr) minmax(6rem, 0.9fr) minmax(6rem, 1fr) minmax(4rem, 0.8fr) auto;
  gap: 6px 8px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.35;
  background: #fff;
  border: 1px solid var(--line);
}
.keep-latest-list li.keep {
  border-color: #A7F3D0;
  background: #ECFDF5;
}
.keep-latest-list li.affect {
  border-color: #FDE68A;
  background: #FFFBEB;
}
.keep-latest-list .t { font-variant-numeric: tabular-nums; color: var(--text); }
.keep-latest-list .h,
.keep-latest-list .m,
.keep-latest-list .s {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.keep-latest-list .id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}
.keep-latest-empty {
  margin: 4px 0 0;
  font-size: 12.5px;
}
.keep-latest-hint {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-line;
}
@media (max-width: 640px) {
  .keep-latest-list li {
    grid-template-columns: 1fr 1fr;
  }
  .keep-latest-list .id { grid-column: 1 / -1; }
}
.ui-confirm-cancel[hidden] {
  display: none !important;
}

/* Prompt / copy / pick list dialogs */
.ui-prompt-card .ui-confirm-body,
.ui-pick-card .ui-confirm-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ui-prompt-label {
  display: block;
  margin: 4px 0 0;
}
.ui-prompt-input,
.ui-copy-input {
  width: 100%;
  box-sizing: border-box;
  min-height: var(--control-h, 38px);
  padding: 8px 10px;
  border: 1px solid var(--line, #E5E7EB);
  border-radius: var(--radius, 6px);
  background: var(--card, #fff);
  color: var(--text, #111827);
  font-size: 14px;
  font-family: var(--font-mono, ui-monospace, Consolas, monospace);
}
.ui-prompt-input:focus,
.ui-copy-input:focus {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 3px rgba(16, 185, 129, 0.25));
  border-color: var(--accent, #059669);
}
.ui-copy-input {
  cursor: text;
}
.ui-pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(48vh, 320px);
  overflow: auto;
  margin: 4px 0 0;
  padding: 2px;
}
.ui-pick-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line, #E5E7EB);
  border-radius: var(--radius, 6px);
  background: var(--hover-bg-soft, #F9FAFB);
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text, #111827);
}
.ui-pick-item:hover {
  border-color: var(--hover-line, #6EE7B7);
  background: var(--hover-bg, #ECFDF5);
}
.ui-pick-item:has(input:checked) {
  border-color: var(--accent, #059669);
  background: var(--add-bg, #ECFDF5);
  box-shadow: inset 0 0 0 1px var(--accent, #059669);
}
.ui-pick-item input {
  margin-top: 2px;
  flex: 0 0 auto;
}
.ui-pick-item span {
  min-width: 0;
  word-break: break-word;
}
.ui-pick-dlg {
  width: min(480px, 94vw);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 860px) {
  .admin-shell,
  .admin-shell.is-side-collapsed,
  html.admin-side-collapsed-boot .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-menu-toggle {
    display: grid;
  }
  .admin-side-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(15, 23, 42, 0.45);
  }
  .admin-side,
  .admin-shell.is-side-collapsed .admin-side,
  html.admin-side-collapsed-boot .admin-side {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: min(280px, 86vw);
    height: 100vh;
    border-right: 1px solid rgba(0, 0, 0, 0.12);
    border-bottom: 0;
    padding: 14px 12px 12px;
    align-items: stretch;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    overflow: visible;
  }
  .admin-shell.is-drawer-open .admin-side,
  .admin-shell.is-drawer-open.is-side-collapsed .admin-side {
    transform: translateX(0);
  }
  .admin-side-close {
    display: grid;
    position: absolute;
    top: 12px;
    right: 10px;
  }
  .admin-side-top {
    position: relative;
    padding-right: 42px;
  }
  .admin-side-toggle { display: none !important; }
  .admin-shell.is-side-collapsed .admin-brand-text,
  .admin-shell.is-side-collapsed .admin-nav-label,
  .admin-shell.is-side-collapsed .admin-nav-text,
  .admin-shell.is-side-collapsed .admin-nav-ext,
  .admin-shell.is-side-collapsed .admin-user-meta,
  .admin-shell.is-side-collapsed .admin-logout-text,
  .admin-shell.is-side-collapsed .admin-back-text,
  html.admin-side-collapsed-boot .admin-brand-text,
  html.admin-side-collapsed-boot .admin-nav-label,
  html.admin-side-collapsed-boot .admin-nav-text,
  html.admin-side-collapsed-boot .admin-nav-ext,
  html.admin-side-collapsed-boot .admin-user-meta,
  html.admin-side-collapsed-boot .admin-logout-text,
  html.admin-side-collapsed-boot .admin-back-text {
    display: initial !important;
  }
  .admin-shell.is-side-collapsed .admin-nav-label,
  html.admin-side-collapsed-boot .admin-nav-label {
    display: block !important;
  }
  .admin-shell.is-side-collapsed .admin-nav-ext,
  html.admin-side-collapsed-boot .admin-nav-ext {
    display: inline-flex !important;
  }
  .admin-shell.is-side-collapsed .admin-nav a,
  .admin-shell.is-side-collapsed .admin-nav .admin-nav-btn,
  html.admin-side-collapsed-boot .admin-nav a,
  html.admin-side-collapsed-boot .admin-nav .admin-nav-btn {
    width: auto;
    height: auto;
    padding: 8px 10px;
    justify-content: flex-start;
    gap: 10px;
  }
  .admin-shell.is-side-collapsed .admin-user-row,
  html.admin-side-collapsed-boot .admin-user-row {
    flex-direction: row;
    width: 100%;
  }
  .admin-shell.is-side-collapsed .admin-side-notify,
  html.admin-side-collapsed-boot .admin-side-notify {
    justify-content: center;
    padding: 0;
  }
  .admin-side-notify .notify-panel,
  .admin-shell.is-side-collapsed .admin-side-notify .notify-panel,
  html.admin-side-collapsed-boot .admin-side-notify .notify-panel {
    left: 0;
    right: auto;
    bottom: calc(100% + 8px);
    top: auto;
    width: min(420px, calc(100vw - 24px));
  }
  .admin-shell.is-side-collapsed .admin-logout .admin-btn-block,
  html.admin-side-collapsed-boot .admin-logout .admin-btn-block,
  .admin-shell.is-side-collapsed .admin-foot-btn,
  html.admin-side-collapsed-boot .admin-foot-btn {
    width: 100%;
    height: auto;
    padding: 6px 4px;
  }
  .admin-shell.is-side-collapsed .admin-foot-actions,
  html.admin-side-collapsed-boot .admin-foot-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .admin-shell.is-side-collapsed .admin-logout-ico,
  .admin-shell.is-side-collapsed .admin-back-ico,
  html.admin-side-collapsed-boot .admin-logout-ico,
  html.admin-side-collapsed-boot .admin-back-ico {
    display: block;
  }
  .admin-nav {
    flex-direction: column;
    flex-wrap: nowrap;
  }
  .admin-nav-label { margin-top: 8px; }
  .admin-nav a { flex: 0 0 auto; width: 100%; }
  .admin-side-foot { flex-direction: column; }
  .admin-foot-actions { width: 100%; }
  .admin-topbar {
    display: flex;
    padding: 10px 16px;
    flex-wrap: wrap;
  }
  .admin-main { padding: 20px 16px 40px; }
  .admin-page-head { flex-direction: column; }
  body.admin-drawer-open {
    overflow: hidden;
  }
}
@media (max-width: 520px) {
  .admin-form-grid { grid-template-columns: 1fr; }
}

/* ?? Pagination (quote-system style) ?? */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 2px 2px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  flex-wrap: wrap;
  background: transparent;
}
.admin-pagination-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  flex-wrap: wrap;
}
.admin-pagination-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pagination-info {
  font-size: 13px;
  color: var(--muted);
}
.admin-pagination-size {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-pagination-size-label {
  font-size: 13px;
  color: var(--muted);
}
.page-size-select {
  width: auto;
  min-width: 64px;
  height: 28px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
}
.admin-pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.page-btn {
  height: 28px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  color: var(--muted);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--hover-line);
  background: var(--hover-bg);
  color: var(--accent2);
}
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.page-btn.active:hover {
  background: var(--accent2);
  border-color: var(--accent2);
  color: #fff;
}
.page-btn:disabled {
  cursor: not-allowed;
  color: #c0c4cc;
  background: #f8fafc;
  opacity: 1;
}
.page-btn-num {
  display: inline-block;
  min-width: 18px;
  text-align: center;
}
.page-ellipsis {
  color: var(--muted);
  padding: 0 4px;
  font-size: 13px;
}

/* Front ops pages: claim / export forms */
.claim-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(200px, 1fr) auto;
  gap: 12px 16px;
  align-items: start;
}
.claim-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.claim-field label,
.claim-label-spacer {
  margin: 0;
  min-height: 18px;
  line-height: 18px;
  font-size: 13px;
  color: var(--muted);
}
.claim-label-spacer { display: block; }
.claim-control {
  min-height: var(--control-h);
  display: flex;
  align-items: center;
}
.claim-field-project .claim-control {
  /* picker root owns dropdown/detail; keep column flow */
  display: block;
  align-items: stretch;
}
.claim-control > *:not(.project-clear) {
  width: 100%;
  margin: 0;
}
.claim-control .project-picker,
.claim-control .project-picker-control,
.claim-control .project-search,
.claim-control select,
.claim-control input[type="file"] {
  width: 100%;
  margin: 0;
}
.claim-control .project-search,
.claim-control select {
  height: var(--control-h);
  min-height: var(--control-h);
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1.25;
  box-sizing: border-box;
}
.claim-control input[type="file"] {
  height: var(--control-h);
  min-height: var(--control-h);
  box-sizing: border-box;
  padding: 5px 8px;
  line-height: 1.2;
  display: block;
}
.claim-field .hint,
.claim-hint-spacer {
  margin: 0;
  min-height: 18px;
  line-height: 18px;
  font-size: 12px;
}
.claim-field-action .claim-control {
  justify-content: flex-end;
}
.claim-field-action .claim-control > * {
  width: auto;
}
.claim-field-action button {
  width: auto;
  margin: 0;
  height: var(--control-h);
  padding: 0 18px;
  white-space: nowrap;
}
.claim-operator-readonly {
  width: 100%;
  min-height: var(--control-h);
  height: var(--control-h);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #F9FAFB;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}
.export-form-grid {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1.4fr) auto;
}
.export-form-grid .claim-field-formats {
  min-width: 0;
}
.export-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  width: 100%;
  min-height: var(--control-h);
}
.claim-control .export-formats {
  margin: 0;
}
.cell-empty {
  color: #c0c4cc;
}
/* Prefer showing content; only soft-clamp extreme lengths inside a scrollable wrap */
.cell-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 28rem;
}
.cell-ellipsis.cell-ellipsis-sm {
  max-width: 20rem;
}
.table-icon-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  line-height: 1.2;
  vertical-align: middle;
  max-width: 100%;
  min-width: 0;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 8px;
  transition: background var(--ease), color var(--ease);
}
button.table-icon-link {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  height: auto;
  color: var(--accent);
  box-shadow: none;
}
.table-icon-link:hover,
a.table-icon-link:hover {
  background: var(--hover-bg);
  color: var(--accent2);
  text-decoration: none;
}
/* 盖过全局 button:hover（深绿实心底会把同色 SVG 吃掉） */
button.table-icon-link:hover:not(:disabled),
button.table-icon-link:active:not(:disabled) {
  background: var(--hover-bg);
  color: var(--accent2);
  text-decoration: none;
  transform: none;
  box-shadow: none;
}
.table-icon-link.is-danger {
  color: var(--muted);
}
.table-icon-link.is-danger:hover,
a.table-icon-link.is-danger:hover,
button.table-icon-link.is-danger:hover:not(:disabled),
button.table-icon-link.is-danger:active:not(:disabled) {
  background: rgba(185, 28, 28, 0.08);
  color: var(--danger);
  text-decoration: none;
  transform: none;
  box-shadow: none;
}
.table-icon-link svg {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex: 0 0 16px;
  display: block;
  overflow: visible;
  opacity: 0.9;
}
.table-icon-link .cell-ellipsis {
  min-width: 0;
  flex: 1 1 auto;
  max-width: none;
}

/*
  Data tables: size by content, do not force-clip normal fields.
  Narrow viewports can scroll via .admin-table-wrap.
*/
.admin-table-wrap > table,
.app-body .card > .admin-table-wrap > table,
.app-body .card > table,
.scan-table,
.settings-result-table,
#jobsTable,
#snapTable,
#ucTable,
#hostTable,
#histTable,
#assetTable,
#userTable,
#auditTable,
#customerTable {
  table-layout: auto;
  width: 100%;
  max-width: 100%;
}
#projectTable {
  table-layout: auto;
  width: 100%;
  max-width: 100%;
}
.admin-table-wrap > table > thead > tr > th,
.admin-table-wrap > table > tbody > tr > td,
.app-body .card > table > thead > tr > th,
.app-body .card > table > tbody > tr > td,
.scan-table > thead > tr > th,
.scan-table > tbody > tr > td,
.settings-result-table > thead > tr > th,
.settings-result-table > tbody > tr > td {
  white-space: nowrap;
  vertical-align: middle;
  overflow: visible;
  text-overflow: clip;
}
/* Delivery list / archive: wrap long customer / folder / project cells */
.admin-table-wrap > table.delivery-list-table {
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
}
.admin-table-wrap > table.delivery-list-table > thead > tr > th,
.admin-table-wrap > table.delivery-list-table > tbody > tr > td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: middle;
}
.admin-table-wrap > table.delivery-list-table > thead > tr > th:nth-child(1),
.admin-table-wrap > table.delivery-list-table > tbody > tr > td:nth-child(1) {
  width: 28%;
  vertical-align: top;
}
.admin-table-wrap > table.delivery-list-table > thead > tr > th:nth-child(2),
.admin-table-wrap > table.delivery-list-table > tbody > tr > td:nth-child(2) {
  width: 12%;
}
.admin-table-wrap > table.delivery-list-table > thead > tr > th:nth-child(3),
.admin-table-wrap > table.delivery-list-table > tbody > tr > td:nth-child(3) {
  width: 32%;
}
.admin-table-wrap > table.delivery-list-table > thead > tr > th:nth-child(4),
.admin-table-wrap > table.delivery-list-table > tbody > tr > td:nth-child(4) {
  width: 9%;
}
.admin-table-wrap > table.delivery-list-table > thead > tr > th:nth-child(5),
.admin-table-wrap > table.delivery-list-table > tbody > tr > td:nth-child(5) {
  width: 11%;
}
.admin-table-wrap > table.delivery-list-table > thead > tr > th:last-child,
.admin-table-wrap > table.delivery-list-table > tbody > tr > td:last-child {
  width: 4.5rem;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  vertical-align: middle;
}
.admin-table-wrap > table.delivery-list-table code.hint {
  display: inline;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.admin-table-wrap > table .cell-ellipsis,
.admin-table-wrap > table .cell-ellipsis-sm,
.app-body .card > table .cell-ellipsis,
.app-body .card > table .cell-ellipsis-sm,
.scan-table .cell-ellipsis,
.scan-table .cell-ellipsis-sm {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
/* Shrink-wrap action / checkbox columns; leave room for buttons */
.admin-table-wrap > table > thead > tr > th:last-child,
.admin-table-wrap > table > tbody > tr > td:last-child,
.admin-table-wrap > table td.table-actions,
.app-body .card > table > thead > tr > th:last-child,
.app-body .card > table > tbody > tr > td:last-child,
.app-body .card > table td.table-actions {
  width: 1%;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
.admin-table-wrap > table td.table-actions,
#jobsTable td.table-actions,
#snapTable td.table-actions,
#tokenTable td.table-actions,
#userTable td.table-actions {
  min-width: 9rem;
}
#snapTable td.table-actions {
  width: 1%;
  white-space: nowrap;
}
#jobsTable td.table-actions .table-icon-link,
#snapTable td:last-child .table-icon-link,
#ucTable td:last-child .table-icon-link,
.admin-table-wrap td:last-child .table-icon-link {
  margin: 0;
  padding: 6px;
  max-width: none;
}
/* ??????????? flex????? td ????? table-cell ?? */
.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}
/*
 * ?? flex ?? td ???????/???????????????????
 * #projectTable ??????????????
 */
td.table-actions,
th.table-actions {
  display: table-cell;
  vertical-align: middle;
  white-space: nowrap;
  margin: 0;
}
td.table-actions > * + * {
  margin-left: 12px;
}
#tokenTable td.token-expire {
  white-space: normal;
  line-height: 1.35;
}
#tokenTable td.token-expire .hint {
  margin: 2px 0 0;
}
.result-btn svg,
.result-path svg,
.result-ico svg {
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
  display: block;
}
.result-ico svg {
  width: 15px;
  height: 15px;
  max-width: 15px;
  max-height: 15px;
}

/* ?? Tooltips: fixed float tip (avoids overflow-x scroll from ::after) ?? */
[data-tip] {
  position: relative;
}
[data-tip]::after,
[data-tip]::before {
  content: none !important;
  display: none !important;
}
.ui-float-tip {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  max-width: min(360px, calc(100vw - 16px));
  padding: 6px 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  white-space: pre-line;
  word-break: break-word;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  pointer-events: none;
}
.ui-float-tip[hidden] {
  display: none !important;
}

@media (max-width: 960px) {
  .claim-form-grid,
  .export-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .claim-field-project,
  .claim-field-formats,
  .claim-field-action {
    grid-column: 1 / -1;
  }
  .claim-field-action .claim-control {
    justify-content: flex-start;
  }
}
@media (max-width: 640px) {
  .claim-form-grid,
  .export-form-grid {
    grid-template-columns: 1fr;
  }
  .claim-field-action button {
    width: 100%;
  }
}

/* ?? UI Alert / Stepper / Toolbar (Modern Tech Minimalist) ?? */
.ui-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius);
  background: #F9FAFB;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.ui-alert-ico {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--accent);
}
.ui-alert-body { min-width: 0; flex: 1; }
.ui-alert-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}
.ui-alert.info {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}
.ui-alert.warn {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}

.ui-stepper {
  list-style: none;
  margin: 0 0 20px;
  padding: 14px 16px;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow-x: auto;
}
.ui-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 0;
  min-width: 140px;
  padding: 4px 16px 4px 4px;
  color: var(--placeholder);
}
.ui-step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 1px;
  height: 28px;
  transform: translateY(-50%);
  background: var(--line);
}
.ui-step-index {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: #F3F4F6;
  color: #6B7280;
  border: 1px solid #E5E7EB;
  flex: 0 0 auto;
}
.ui-step-meta { min-width: 0; }
.ui-step-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: inherit;
}
.ui-step-title {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: #9CA3AF;
  white-space: nowrap;
}
.ui-step.is-active {
  color: var(--accent);
}
.ui-step.is-active .ui-step-index {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.ui-step.is-active .ui-step-title {
  color: var(--text);
}
.ui-step.is-done {
  color: var(--accent);
}
.ui-step.is-done .ui-step-index {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #047857;
}
.ui-step.is-done .ui-step-title {
  color: var(--muted);
}

.page-head {
  margin-bottom: 8px;
}
.page-head h1 {
  margin: 0 0 10px;
}

.toolbar.scan-filters,
.scan-filters.toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
  padding: 12px;
  background: #F9FAFB;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: visible;
}
.toolbar .filter-group,
.scan-filters.toolbar .filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.toolbar .filter-group .check-inline,
.scan-filters .check-inline {
  flex: 0 0 auto;
  white-space: nowrap;
  gap: 4px;
}
.toolbar .filter-group .btn-sm,
.scan-filters .filter-group .btn-sm {
  flex: 0 0 auto;
  white-space: nowrap;
}
.toolbar #hostFilter,
.scan-filters.toolbar #hostFilter {
  height: var(--control-h);
  min-width: 180px;
  max-width: 260px;
  margin: 0;
  padding: 0 12px;
  font-size: 13px;
}
.toolbar .btn-sm,
.scan-filters .btn-sm {
  height: var(--control-h-sm);
  min-height: var(--control-h-sm);
  padding: 0 10px !important;
}

.scan-table-wrap {
  border-radius: var(--radius);
}

.scan-cred-grid {
  gap: 16px 24px;
}
.scan-cred-grid > div {
  display: flex;
  flex-direction: column;
}

code {
  font-family: var(--font-mono);
  font-size: 12px;
}

@media (max-width: 720px) {
  .ui-stepper {
    flex-direction: column;
    gap: 10px;
  }
  .ui-step {
    min-width: 0;
    padding-right: 4px;
  }
  .ui-step:not(:last-child)::after {
    display: none;
  }
}

/* ---- In-app notifications (bell) ---- */
.notify-wrap {
  position: relative;
  flex: 0 0 auto;
}
.notify-bell {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #F1F5F9;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.notify-bell:hover,
.notify-bell[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}
.notify-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--warn);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
}
.notify-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: min(480px, calc(100vw - 24px));
  max-height: min(560px, 78vh);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}
.notify-panel[hidden] {
  display: none !important;
}
.notify-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex: 0 0 auto;
}
.notify-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.01em;
}
.notify-read-all {
  height: auto;
  min-height: 0;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  white-space: nowrap;
  transform: none;
  box-shadow: none;
}
.notify-read-all:hover,
.notify-read-all:active:not(:disabled) {
  color: var(--accent2);
  background: rgba(16, 185, 129, 0.08);
  text-decoration: none;
  transform: none;
  box-shadow: none;
}
.notify-list {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: min(480px, 68vh);
  min-height: 120px;
  overscroll-behavior: contain;
}
.notify-empty {
  padding: 36px 20px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
}
/* Reset global `button` chrome — rows need natural content height (same pattern as project-option). */
button.notify-item,
.notify-item {
  appearance: none;
  -webkit-appearance: none;
  display: flex !important;
  flex-direction: column;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  text-align: left;
  border: none !important;
  border-radius: 0 !important;
  border-bottom: 1px solid #f1f5f9 !important;
  border-left: 3px solid transparent !important;
  background: #fff !important;
  padding: 14px 18px 14px 15px !important;
  cursor: pointer;
  color: #0f172a !important;
  font: inherit;
  font-size: 14px;
  font-weight: 400 !important;
  line-height: 1.45;
  white-space: normal !important;
  box-sizing: border-box;
  transform: none !important;
  box-shadow: none !important;
}
button.notify-item::before,
button.notify-item::after,
.notify-item::before,
.notify-item::after {
  content: none !important;
  display: none !important;
  border: none !important;
}
button.notify-item:last-child,
.notify-item:last-child {
  border-bottom: none !important;
}
button.notify-item:hover:not(:disabled),
button.notify-item:active:not(:disabled),
button.notify-item:focus-visible,
.notify-item:hover,
.notify-item:active,
.notify-item:focus-visible {
  background: #f8fafc !important;
  color: #0f172a !important;
  transform: none !important;
  box-shadow: none !important;
  outline: none;
}
button.notify-item.is-unread,
.notify-item.is-unread {
  background: #ecfdf5 !important;
  border-left-color: var(--accent) !important;
}
button.notify-item.is-unread:hover:not(:disabled),
button.notify-item.is-unread:active:not(:disabled),
.notify-item.is-unread:hover,
.notify-item.is-unread:active {
  background: #d1fae5 !important;
  border-left-color: var(--accent) !important;
  transform: none !important;
  box-shadow: none !important;
}
.notify-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.45;
}
.notify-item-body {
  margin-top: 6px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notify-item-time {
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.3;
}

/* Admin content topbar: mobile hamburger only (desktop hidden) */
.admin-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 52px;
  padding: 10px 16px;
  background: rgba(248, 250, 252, 0.92);
  border-bottom: 1px solid #e2e8f0;
  backdrop-filter: blur(8px);
  box-sizing: border-box;
}
.admin-topbar .admin-menu-toggle {
  order: -1;
  margin-right: 0;
}

/* ?? ??????? ?? */
.barcode-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.2fr);
  gap: 16px;
  align-items: start;
}
.barcode-input-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.barcode-input-head label {
  margin: 0;
}
.barcode-stats {
  font-size: 12px;
  color: var(--muted, #64748b);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.barcode-editor {
  display: grid;
  grid-template-columns: auto 1fr;
  height: min(70vh, 520px);
  min-height: 280px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
  box-sizing: border-box;
}
.barcode-gutter {
  margin: 0;
  padding: 12px 0;
  min-width: 2.6em;
  height: 100%;
  overflow: hidden;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
  background: #0b1220;
  border-right: 1px solid #1e293b;
  user-select: none;
  box-sizing: border-box;
}
.barcode-gutter span {
  display: block;
  padding: 0 10px 0 12px;
}
.barcode-input-pane textarea,
.barcode-editor textarea {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 12px 12px 12px 10px;
  border: none;
  border-radius: 0;
  resize: none;
  overflow: auto;
  background: transparent;
  color: #e2e8f0;
  caret-color: #93c5fd;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre;
  tab-size: 2;
  box-sizing: border-box;
}
.barcode-editor textarea:focus {
  outline: none;
  box-shadow: none;
}
.barcode-editor textarea::placeholder {
  color: #64748b;
}
.barcode-toolbar {
  margin-top: 10px;
  margin-bottom: 0;
}
.barcode-qr-opts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}
.barcode-qr-opts[hidden] {
  display: none !important;
}
.barcode-opt {
  margin: 0;
  font-size: 13px;
  color: var(--muted, #64748b);
  user-select: none;
}
.barcode-progress {
  margin-top: 8px;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.barcode-progress[hidden] {
  display: none !important;
}
.barcode-progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent, #059669);
  transition: width 0.15s ease;
}
.barcode-preview-pane {
  min-height: 280px;
  max-height: min(70vh, 720px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.barcode-empty {
  margin: auto;
  padding: 24px;
  text-align: center;
}
.barcode-item {
  display: grid;
  grid-template-columns: 2.4em 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px dashed #e2e8f0;
}
.barcode-item:last-child { border-bottom: none; }
.barcode-line-no {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.2;
  color: #64748b;
  text-align: right;
  user-select: none;
}
.barcode-item-body {
  display: flex;
  justify-content: center;
  min-width: 0;
}
.barcode-item-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: start;
}
.barcode-copy-btn {
  margin: 0;
  padding: 2px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #f8fafc;
  color: #64748b;
  font: inherit;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}
.barcode-copy-btn:hover {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}
.barcode-copy-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.barcode-item svg { max-width: 100%; height: auto; }
.barcode-item.is-qr .barcode-item-body {
  justify-content: flex-start;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.barcode-item svg.barcode-qr {
  width: min(180px, 100%);
  height: auto;
  aspect-ratio: 1;
  background: #fff;
}
.barcode-qr-caption {
  display: none;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.25;
  color: #334155;
  word-break: break-all;
}
.barcode-preview-pane.is-qr .barcode-item {
  align-items: start;
}
.barcode-preview-pane.is-qr.is-multi-col {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px 12px;
  align-content: start;
}
.barcode-preview-pane.is-qr.is-multi-col .barcode-empty {
  grid-column: 1 / -1;
}
.barcode-preview-pane.is-qr.is-multi-col .barcode-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  border-bottom: 1px solid #e2e8f0;
  align-items: stretch;
  min-width: 0;
}
.barcode-preview-pane.is-qr.is-multi-col .barcode-line-no {
  text-align: left;
  font-size: 11px;
}
.barcode-preview-pane.is-qr.is-multi-col .barcode-item-body {
  align-items: center;
}
.barcode-preview-pane.is-qr.is-multi-col .barcode-item-actions {
  align-items: center;
  align-self: center;
}
.barcode-preview-pane.is-qr.is-multi-col .barcode-copy-btn {
  width: auto;
  padding: 1px 5px;
  font-size: 10px;
}
.barcode-preview-pane.is-qr.is-multi-col .barcode-item svg.barcode-qr {
  width: 100%;
  max-width: none;
}
.barcode-preview-pane.is-qr.is-multi-col .barcode-qr-caption {
  display: block;
  text-align: center;
  max-height: 2.5em;
  overflow: hidden;
}
.barcode-item.is-error {
  grid-template-columns: 2.4em 1fr;
}
.barcode-item.is-error .barcode-item-body { justify-content: flex-start; }
.barcode-error {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #b91c1c;
  font-size: 13px;
}
.barcode-mobile-tabs {
  display: none;
  gap: 6px;
  margin-bottom: 12px;
}
.barcode-tab {
  flex: 1 1 0;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.barcode-tab.is-on {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}
.sn-with-barcode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  flex-wrap: wrap;
}
.sn-barcode-link {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #d1fae5;
  background: #ecfdf5;
  color: #047857 !important;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
}
.sn-barcode-link:hover {
  background: #d1fae5;
  color: #065f46 !important;
}

/* SN 二维码预览弹窗 */
.qr-preview-dlg {
  max-width: min(380px, calc(100vw - 24px));
  width: min(380px, calc(100vw - 24px));
}
.qr-preview-card {
  margin: 0;
  padding: var(--dlg-pad);
  border: 1px solid var(--line);
  border-radius: var(--dlg-radius);
  background: var(--card);
  box-shadow: var(--dlg-shadow);
}
.qr-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.qr-preview-titles {
  min-width: 0;
}
.qr-preview-title,
.qr-preview-title.dlg-title {
  margin: 0 0 4px;
  font-size: var(--dlg-title-size);
  font-weight: var(--dlg-title-weight);
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}
.qr-preview-text {
  display: block;
  max-width: 100%;
  font-size: 12.5px;
  word-break: break-all;
  color: var(--muted);
}
.qr-preview-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: #f1f5f9;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.qr-preview-close:hover {
  background: #e2e8f0;
  color: var(--text);
}
.qr-preview-body {
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}
.qr-preview-loading {
  font-size: 13px;
}
.qr-preview-svg,
.qr-preview-body svg {
  width: min(220px, 70vw);
  height: auto;
  aspect-ratio: 1;
  background: #fff;
}
.qr-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.qr-preview-actions > button,
.qr-preview-actions > .btn,
.qr-preview-actions > a {
  margin-top: 0;
}
.qr-preview-actions a.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-h-sm);
  min-height: var(--control-h-sm);
  padding: 0 10px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
  line-height: 1.2;
}
.qr-preview-actions a.btn-sm:hover {
  background: var(--accent2);
  color: #fff !important;
}
.qr-preview-hint {
  margin: 8px 0 0;
  min-height: 1.2em;
}
@media (max-width: 860px) {
  .barcode-mobile-tabs {
    display: flex;
  }
  .barcode-layout {
    grid-template-columns: 1fr;
  }
  .barcode-page[data-mobile-tab="input"] [data-pane="preview"],
  .barcode-page[data-mobile-tab="preview"] [data-pane="input"] {
    display: none !important;
  }
  .barcode-page[data-mobile-tab="preview"] .barcode-preview-pane {
    max-height: none;
    min-height: 50vh;
  }
}
@media print {
  .app-topbar,
  .app-m-guide,
  .app-nav-drawer,
  .app-nav-scrim,
  .barcode-mobile-tabs,
  .page-head,
  .barcode-input-pane,
  .barcode-item-actions,
  .nav-logout { display: none !important; }
  .app-main { padding: 0 !important; }
  .barcode-page { box-shadow: none !important; border: none !important; }
  .barcode-layout { display: block; }
  .barcode-preview-pane,
  .barcode-page[data-mobile-tab] [data-pane="preview"] {
    display: flex !important;
    max-height: none;
    overflow: visible;
    border: none;
    padding: 0;
  }
  .barcode-item {
    break-inside: avoid;
    page-break-inside: avoid;
    border: none;
    padding: 12px 0;
    grid-template-columns: 2.4em 1fr;
  }
  @page {
    margin: 10mm;
  }

  .barcode-page.is-qr-format .barcode-preview-pane.is-multi-col {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(36mm, 1fr));
    gap: 6mm 8mm;
    align-content: start;
  }
  .barcode-page.is-qr-format .barcode-preview-pane.is-multi-col .barcode-item {
    border: none;
    padding: 0;
    border-radius: 0;
  }
  .barcode-page.is-qr-format .barcode-preview-pane.is-multi-col .barcode-item svg.barcode-qr {
    width: 100%;
    max-width: 40mm;
  }
  .barcode-page.is-qr-format .barcode-preview-pane.is-multi-col .barcode-qr-caption {
    display: block;
    text-align: center;
    font-size: 9pt;
    max-height: none;
    overflow: visible;
  }

  .barcode-page.is-dense-print .barcode-preview-pane {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(26mm, 1fr));
    gap: 3.5mm 4mm;
    align-content: start;
  }
  .barcode-page.is-dense-print .barcode-item {
    display: flex;
    flex-direction: column;
    gap: 1.2mm;
    padding: 0;
    border: none;
    align-items: stretch;
  }
  .barcode-page.is-dense-print .barcode-line-no {
    text-align: left;
    font-size: 7pt;
  }
  .barcode-page.is-dense-print .barcode-item-body {
    align-items: center;
    flex-direction: column;
    gap: 1mm;
  }
  .barcode-page.is-dense-print .barcode-item svg.barcode-qr {
    width: 100%;
    max-width: 28mm;
  }
  .barcode-page.is-dense-print .barcode-qr-caption {
    display: block;
    text-align: center;
    font-size: 7.5pt;
    line-height: 1.15;
    max-height: none;
    overflow: visible;
  }
}


/* ???? Assets admin / detail UX ???? */
.admin-focus-bar {
  margin: 0 0 12px;
}
.admin-focus-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #F8FAFC;
}
.admin-focus-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.admin-focus-title {
  font-size: 13px;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.admin-focus-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}
.admin-focus-stats span {
  white-space: nowrap;
}
.asset-sn-cell .asset-sn-sub,
.asset-note-cell .asset-sn-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.asset-own-cell .asset-own-status {
  margin-top: 4px;
}
.asset-count-cell {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.asset-count-badge {
  display: inline-block;
  font-size: 11px;
  line-height: 1.2;
  padding: 1px 5px;
  border-radius: 4px;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
}
.asset-count-badge.is-bad {
  background: #FEF2F2;
  color: #B91C1C;
  border-color: #FECACA;
}
.asset-own-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2.4fr) repeat(3, minmax(88px, 1fr));
  gap: 10px 20px;
  align-items: start;
}
.asset-own-field {
  min-width: 0;
}
.asset-own-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.3;
}
.asset-own-value {
  line-height: 1.4;
  word-break: break-word;
}
.asset-own-job {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}
.asset-own-customer {
  color: var(--accent2);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.4;
  word-break: break-word;
}
.asset-own-customer:hover {
  text-decoration: underline;
}
.asset-own-contract {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 999px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: var(--accent2);
  text-decoration: none;
  line-height: 1.4;
}
.asset-own-contract:hover {
  background: #D1FAE5;
  text-decoration: none;
}
.asset-own-contract code {
  font-size: 12px;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.asset-own-project {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
}
.asset-own-field--note {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
@media (max-width: 860px) {
  .asset-own-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .asset-own-field--job {
    grid-column: 1 / -1;
  }
}
@media (max-width: 520px) {
  .asset-own-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.asset-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.asset-photo-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.asset-photo-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #F1F5F9;
}
.asset-photo-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 0 8px 8px;
  font-size: 12px;
}
.asset-fold-card {
  padding: 0;
}
.asset-fold-card > .asset-fold-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  padding: 14px 16px;
  user-select: none;
}
.asset-fold-card > .asset-fold-summary::-webkit-details-marker {
  display: none;
}
.asset-fold-card > .asset-fold-summary h2 {
  margin: 0;
  font-size: 1.05rem;
}
.asset-fold-card[open] > .asset-fold-summary {
  border-bottom: 1px solid var(--line);
}
.asset-fold-body {
  padding: 14px 16px 16px;
}

/* Link-based toolbar segs (delivery 进行中/已结项) match control height via list-toolbar rules */
