#wrapper { min-height: 100vh; }
.sidebar { width: 220px; min-height: 100vh; flex-shrink: 0; }
.sidebar-head { font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .nav-link { color: #c9d1d9; border-radius: 6px; margin-bottom: 2px; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active { background: #0d6efd; color: #fff; }
.main { min-width: 0; }

/* 移动端抽屉 */
@media (max-width: 991px) {
  .sidebar { position: fixed; left: -240px; top: 0; bottom: 0; z-index: 1040; transition: left .25s; }
  #wrapper.toggled .sidebar { left: 0; box-shadow: 0 0 20px rgba(0,0,0,.3); }
  /* 真实遮罩层：可点击关闭 */
  .sidebar-overlay { display: none; }
  #wrapper.toggled .sidebar-overlay {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.4); border: 0; z-index: 1035;
  }
  /* 使关闭按钮/汉堡按钮高于侧边栏，始终保持可点 */
  .menu-toggle { position: relative; z-index: 1042; }
  /* 侧边栏打开时隐藏汉堡按钮，避免左上角压住侧边栏标题 */
  #wrapper.toggled .menu-toggle { display: none; }
}

/* 照片网格 */
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-grid a { position: relative; display: block; }
.photo-grid img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid #dee2e6; }

/* 图片灯箱：点击缩略图放大查看 */
.photo-grid img[data-lightbox], .photo-thumb { cursor: zoom-in; }
.lightbox-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: opacity .2s ease; cursor: zoom-out; }
.lightbox-overlay.open { opacity: 1; visibility: visible; }
.lightbox-overlay .lightbox-stage { max-width: 100%; max-height: 100%; }
.lightbox-overlay img { max-width: 100%; max-height: 92vh; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
/* 左右切换箭头 */
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: none; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 0 0 4px; user-select: none; -webkit-tap-highlight-color: transparent; }
.lightbox-nav:hover { background: rgba(255,255,255,.32); }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
/* 底部计数器 1/5 */
.lightbox-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; background: rgba(0,0,0,.5); padding: 2px 12px; border-radius: 12px; pointer-events: none; }

/* 上传照片卡片：虚线方形 + 加号 + 文字（参考需求截图） */
.upload-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 96px; height: 96px; border: 2px dashed #8b8bf5; border-radius: 8px; background: #fff; color: #6366f1; cursor: pointer; transition: background .15s; margin: 0; }
.upload-tile:hover { background: #f4f4ff; }
.upload-tile .plus { font-size: 30px; line-height: 1; font-weight: 300; }
.upload-tile .txt { font-size: 12px; }
.upload-tile input[type="file"] { display: none; }

/* 关键点卡片 */
.item-card { border: 1px solid #dee2e6; border-radius: 8px; padding: 14px; margin-bottom: 14px; background: #fff; }
.item-card.done { background: #f0f9f0; border-color: #c3e6cb; }

/* 表格在手机上横向滚动 */
.table-responsive { -webkit-overflow-scrolling: touch; }

/* 列表单元格一律不换行：避免长文本折行导致行高过大。超长内容由 .table-responsive 提供横向滚动 */
.table-nowrap { font-size: 13px; }
.table-nowrap th, .table-nowrap td { white-space: nowrap !important; padding: .4rem .5rem; text-align: center !important; }
.table-nowrap th { font-size: 12px; font-weight: 600; }
/* 单元格内多个按钮/表单：flex 容器禁止子项折行（white-space 对 inline-block 元素折行控制有限） */
.table-nowrap td .row-actions { display: flex !important; flex-wrap: nowrap !important; gap: .25rem; justify-content: center; }
.table-nowrap td .row-actions .btn, .table-nowrap td .row-actions form, .table-nowrap td .row-actions form * { white-space: nowrap !important; }
/* 列表内按钮更紧凑：覆盖 Bootstrap .btn-sm 默认 padding/font-size */
.table-nowrap td .row-actions .btn { padding: 2px 8px; font-size: 12px; line-height: 1.4; }
/* 状态徽章也跟着小一点 */
.table-nowrap td .badge { font-size: 11px; padding: .25em .55em; }

/* ===== 工单执行页（手机为主）：整体紧凑一档 ===== */
.execute-page { font-size: 14px; }
.execute-page h5 { font-size: 1.1rem; margin-bottom: .25rem; }
.execute-page p { font-size: 12px; margin-bottom: .5rem; }
.execute-page .alert { font-size: 12px; padding: .35rem .65rem; margin-bottom: .5rem; }
.execute-page .item-card { padding: 10px 12px; margin-bottom: 10px; }
.execute-page .item-card .text-muted.small { font-size: 11px; }
.execute-page .btn { font-size: 12px; padding: 3px 9px; }
.execute-page .btn-sm { padding: 2px 7px; }
.execute-page .btn-lg { font-size: 14px; padding: 6px 14px; }
.execute-page .btn.btn-danger.btn-sm { padding: 0 6px; font-size: 11px; line-height: 16px; }
.execute-page .photo-grid img { width: 80px; height: 80px; }
.execute-page .upload-tile { width: 80px; height: 80px; }
.execute-page .upload-tile .plus { font-size: 24px; }
.execute-page .upload-tile .txt { font-size: 11px; }
.execute-page .badge { font-size: 11px; padding: .25em .55em; }
