/* Shared production component additions on top of ui-theme.css. */
.modal-copy {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

#app-toast.toast {
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

#app-toast.toast.show {
  opacity: 1;
  pointer-events: auto;
}

.photo-item {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #fff;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-add {
  border-style: dashed;
  cursor: pointer;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
}

.photo-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--brand-weak);
}

.photo-add svg {
  width: 22px;
  height: 22px;
}

.photo-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(15, 23, 42, .62);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-delete:hover {
  background: var(--danger);
}

.photo-delete svg {
  width: 14px;
  height: 14px;
}

.photo-empty {
  background: var(--bg-page);
}

.mobile-content {
  position: relative;
}

.mobile-float-back {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 40;
  border-radius: 4px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.mobile-float-back:hover {
  background: #fff;
  color: var(--primary);
  border-color: var(--primary);
}

.sidebar-logout {
  width: calc(100% - 24px);
  margin: 8px 12px 12px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.sidebar-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-weak);
}
/* ========== Components ========== */
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.comp-card { background: #fff; border: 1px solid var(--border); border-radius: 4px; box-shadow: var(--shadow-card); overflow: hidden; }
.comp-card-head { padding: 12px 16px; border-bottom: 1px solid var(--border-light); font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; }
.comp-card-head .tag { font-size: 11px; font-weight: 400; color: var(--text-tertiary); }
.comp-card-body { padding: 16px; min-height: 108px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.comp-card-body.row { flex-direction: row; align-items: center; flex-wrap: wrap; }
.state-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.state-label { font-size: 11px; color: var(--text-tertiary); width: 100%; letter-spacing: .02em; }
.comp-caption { font-size: 12px; color: var(--text-tertiary); }

/* ========== Buttons ========== */
.btn {
    height: 36px; padding: 0 16px; border-radius: 4px; font-size: 14px; font-weight: 500;
    border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
    white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:active:not(:disabled) { background: #1e40af; }
.btn-secondary { background: #fff; border: 1px solid var(--border); color: #334155; }
.btn-secondary:hover:not(:disabled) { background: var(--hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-sm { height: 34px; padding: 0 16px; border-radius: 4px; }
.btn-link { height: 30px; padding: 0 12px; background: transparent; color: var(--primary); font-size: 13px; border-radius: 4px; border: 0; outline: 0; }
.btn-link:hover { color: var(--primary-hover); text-decoration: underline; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 4px; background: transparent; color: var(--text-secondary); border: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: var(--hover); color: var(--primary); }
.btn-icon.danger:hover { background: var(--danger-weak); color: var(--danger); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn.loading .btn-spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-secondary.loading .btn-spinner { border-color: var(--border-dark); border-top-color: var(--primary); }
.btn .icon { width: 16px; height: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ========== Inputs / Chips / Search ========== */
.search-box {
    width: 288px; height: 36px; display: flex; align-items: center; gap: 10px;
    background: var(--bg-page); border: 1px solid transparent; border-radius: 4px;
    padding: 0 14px;
}
.search-box:focus-within { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(51,112,255,.12); }
.search-box svg { width: 16px; height: 16px; color: var(--text-tertiary); flex-shrink: 0; }
.search-box input { border: 0; background: transparent; outline: 0; flex: 1; font-size: 14px; color: var(--text-primary); min-width: 0; }
.search-box input::placeholder { color: var(--text-tertiary); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    height: 30px; padding: 0 12px; border-radius: 4px; background: #fff;
    border: 1px solid var(--border); color: var(--text-secondary); font-size: 13px;
}
.chip:hover { background: var(--hover); }
.chip.active { background: var(--brand-weak); border-color: var(--primary); color: var(--primary); font-weight: 500; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-label .hint { font-weight: 400; color: var(--text-tertiary); margin-left: 8px; }
.form-input {
    height: 34px; border: 1px solid var(--border); border-radius: 4px; padding: 0 12px;
    font-size: 14px; color: var(--text-primary); background: #fff; outline: 0; width: 100%;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(51,112,255,.12); }
.form-input::placeholder { color: var(--text-tertiary); }
select.form-input { height: 34px; padding-right: 28px; }
.upload-zone {
    border: 1px dashed var(--border-dark); border-radius: 4px; background: var(--bg-page);
    padding: 18px; text-align: center; color: var(--text-secondary); font-size: 13px;
}
.upload-zone .up-title { font-weight: 500; color: var(--text-primary); }
.upload-zone .up-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* ========== Badges / Status ========== */
.status-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); padding: 2px 4px; border-radius: 4px; white-space: nowrap; }
.status-badge .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--success); }
.dot-gray { background: var(--neutral); }
.dot-orange { background: var(--warning); }
.dot-red { background: var(--danger); }
.dot-blue { background: var(--primary); }
.role-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 11px; font-size: 12px; white-space: nowrap; }
.role-admin { background: var(--brand-weak); color: var(--primary); }
.role-viewer { background: #f8fafc; color: #475569; border: 1px solid var(--border-light); }
.role-pending { background: #fff7ed; color: #c2410c; }
.plan-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.plan-running { background: var(--brand-weak); color: var(--primary); }
.plan-finished { background: #ecfdf5; color: #047857; }
.plan-cancelled { background: #f1f5f9; color: #64748b; }

/* ========== Table / Cards / Pagination ========== */
.table-card {
    background: #fff; border: 1px solid var(--border); border-radius: 4px;
    box-shadow: var(--shadow-card); overflow: hidden; display: flex; flex-direction: column;
    min-height: 0;
}
.toolbar { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
.toolbar-note { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
.table-wrap { overflow: auto; flex: 1; }
table.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table th {
    position: sticky; top: 0; z-index: 2; background: var(--bg-table-alt);
    font-size: 12px; font-weight: 550; color: var(--text-secondary); letter-spacing: .01em;
    padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap;
}
.spec-table td {
    padding: 0 16px; height: 52px; border-bottom: 1px solid var(--border-light);
    vertical-align: middle; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
}
.spec-table tbody tr:last-child td { border-bottom: 0; }
.spec-table tbody tr:nth-child(even) { background: #fafbfc; }
.spec-table tbody tr:hover { background: var(--hover); }
.spec-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.spec-table .action-col { text-align: right; }
.link-blue { color: var(--primary); font-weight: 500; text-decoration: none; }
.link-blue:hover { text-decoration: underline; }
.pagination {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 20px; border-top: 1px solid var(--border-light); font-size: 13px; color: var(--text-secondary);
}
.pg-left { display: flex; align-items: center; gap: 10px; }
.pg-right { display: flex; align-items: center; gap: 4px; }
.pg-btn {
    min-width: 30px; height: 30px; padding: 0 8px; border-radius: 4px; border: 0;
    background: transparent; color: var(--text-secondary); font-size: 13px;
}
.pg-btn:hover { background: var(--hover); }
.pg-btn.current { background: var(--bg-table-alt); color: var(--text-primary); font-weight: 600; }
.pg-btn.disabled { opacity: .5; cursor: not-allowed; }
.pg-select { height: 32px; border: 1px solid var(--border); border-radius: 4px; background: #fff; padding: 0 8px; font-size: 13px; color: var(--text-secondary); }

/* ========== KPI ========== */
.kpi-panel {
    background: #fff; border: 1px solid var(--border); border-radius: 4px;
    box-shadow: var(--shadow-card); overflow: hidden; display: flex; align-items: stretch;
}
.kpi-total { background: var(--primary); color: #fff; padding: 20px 24px; flex: 1 1 0; min-width: 0; }
.kpi-total .kpi-value { font-size: var(--fs-kpi); font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.kpi-total .kpi-label { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.85); margin-top: 3px; }
.kpi-col { flex: 1 1 0; min-width: 0; padding: 20px 24px; border-left: 1px solid var(--border-light); }
.kpi-overview .kpi-col { cursor: default; }
.kpi-overview .kpi-col[data-action]:hover { background: var(--hover); }
.kpi-col .kpi-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); line-height: 1.3; }
.kpi-col .kpi-label .ratio { color: var(--border-dark); font-weight: 400; }
.kpi-col .kpi-value { font-size: var(--fs-kpi); font-weight: 600; line-height: 1.2; color: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: -.3px; margin-top: 3px; }
.kpi-col.active { background: var(--brand-weak); }
.kpi-col.active .kpi-value, .kpi-col.active .kpi-label { color: var(--primary); }
.kpi-col.active + .kpi-col { border-left-color: #dbeafe; }
.asset-section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.asset-list-section { flex: 1; min-height: 0; }
.asset-list-section .table-card { flex: 1; min-height: 0; }
.section-caption { font-size: var(--fs-section); font-weight: 600; line-height: 1.4; color: var(--text-primary); }
.toolbar-label { flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.mini-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.mini-stat { flex: 1 1 160px; background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 16px; box-shadow: var(--shadow-card); }
.mini-stat .label { font-size: 12px; color: var(--text-secondary); }
.mini-stat .value { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ========== Progress ========== */
.progress { height: 8px; border-radius: 4px; background: #eef2f6; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.progress.p-success i { background: var(--success); }
.progress.p-warning i { background: var(--warning); }
.progress.p-gray i { background: var(--neutral); }
.progress-wrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.progress-wrap .progress { flex: 1; min-width: 60px; }
.progress-text { font-size: 12px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ========== Modal / Toast / States ========== */
.modal-mask {
    position: absolute; inset: 0; background: rgba(15, 23, 42, .45); z-index: 60;
    display: flex; align-items: center; justify-content: center; padding: 24px;
    animation: fadeIn .18s ease;
}
.modal {
    width: min(560px, 100%); max-height: 100%; background: #fff; border-radius: 4px;
    box-shadow: var(--shadow-modal); overflow: hidden; display: flex; flex-direction: column;
    animation: popIn .16s ease;
}
.modal-head { padding: 14px 20px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 10px; }
.tab-row { display: flex; gap: 4px; background: var(--bg-page); border: 1px solid var(--border-light); border-radius: 4px; padding: 3px; width: fit-content; }
.tab {
    height: 30px; padding: 0 14px; border-radius: 4px; border: 0; background: transparent;
    color: var(--text-secondary); font-size: 13px;
}
.tab.active { background: #fff; color: var(--primary); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.97) translateY(4px); } to { opacity: 1; transform: none; } }
.toast {
    position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80;
    display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 4px;
    background: #1f2937; color: #fff; font-size: 13px; box-shadow: var(--shadow-modal); white-space: nowrap;
}
.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }
.toast svg { width: 16px; height: 16px; }
.state-block { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 44px 20px; color: var(--text-tertiary); text-align: center; }
.state-block .state-icon { width: 40px; height: 40px; opacity: .55; }
.state-block .state-icon.state-icon-spin svg { animation: spin 1s linear infinite; }
/* 计划页/盘点页内联加载文案的 sync 图标同步旋转 */
.w4-asset-loading svg, .w4-uploading svg { animation: spin 1s linear infinite; }
.state-block .state-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.state-block .state-hint { font-size: 13px; }
.skeleton-row { height: 16px; border-radius: 4px; background: linear-gradient(90deg, #eef2f6 25%, #f8fafc 50%, #eef2f6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton-row.sm { height: 12px; width: 60%; }
.skeleton-row.md { width: 80%; }
.skeleton-row.lg { width: 100%; }
@keyframes shimmer { to { background-position: -200% 0; } }
