/* --- 使用率サマリー --- */
.stats-bar {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.stat-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 10px 16px; min-width: 100px; text-align: center;
}
.stat-card--total {
  background: #1e293b; color: #fff; border-color: #1e293b;
}
.stat-card--total .stat-label { color: #cbd5e1; }
.stat-card--total .stat-rate { color: #fff; }
.stat-card--total .stat-detail { color: #94a3b8; }
.stat-label { font-size: 11px; color: #64748b; margin-bottom: 2px; }
.stat-rate { font-size: 20px; font-weight: 700; color: #1e293b; }
.stat-detail { font-size: 11px; color: #94a3b8; }

/* --- フロア選択 --- */
.floor-selector { display: flex; gap: 8px; margin-bottom: 16px; }
.floor-btn {
  padding: 8px 20px; border: 2px solid #e2e8f0; border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s;
}
.floor-btn:hover { border-color: #2563eb; }
.floor-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* --- 凡例 --- */
.legend { display: flex; gap: 16px; margin-bottom: 16px; align-items: center; font-size: 12px; color: #64748b; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-box { width: 20px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,0.1); }
.legend-box.full { background: #2563eb; }
.legend-box.empty { background: #f1f5f9; }

/* --- マップコンテナ --- */
.map-container { display: flex; flex-direction: column; gap: 8px; }
.aisle-row { display: flex; gap: 8px; align-items: flex-start; }
.passageway {
  display: flex; align-items: center; justify-content: center; height: 28px;
  font-size: 10px; color: #94a3b8; letter-spacing: 2px;
}

/* --- 棚列グループ --- */
.aisle-group {
  background: #fff; border-radius: 8px; padding: 12px 16px;
  border: 1px solid #e2e8f0; flex: 1;
}
.aisle-label { font-size: 13px; font-weight: 600; color: #1e293b; margin-bottom: 8px; }
.shelf-grid { display: flex; flex-wrap: wrap; gap: 5px; }

/* --- 棚セル（段分割表示） --- */
.shelf-cell {
  width: 52px; min-height: 40px; border-radius: 6px; display: flex; flex-direction: column;
  align-items: center; cursor: pointer; transition: all 0.15s;
  font-size: 11px; font-weight: 500; position: relative;
  background: #f8fafc; border: 1px solid #e2e8f0; padding: 2px;
}
.shelf-cell:hover { transform: scale(1.1); z-index: 10; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.shelf-cell .shelf-code { font-size: 10px; font-weight: 600; color: #64748b; margin-bottom: 2px; }

/* --- 段スタック --- */
.level-stack {
  display: flex; flex-direction: column; gap: 1px; width: 100%;
}
.level-bar {
  height: 6px; border-radius: 2px; background: #e2e8f0;
}
.level-bar.stocked {
  background: #2563eb;
}

/* --- 詳細パネル --- */
.detail-panel {
  position: fixed; right: 0; top: 0; width: 360px; height: 100vh; background: #fff;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15); transform: translateX(100%); transition: transform 0.3s;
  z-index: 1000; overflow-y: auto;
}
.detail-panel.open { transform: translateX(0); }
.detail-panel-header {
  background: #1e293b; color: #fff; padding: 16px; display: flex;
  justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1;
}
.detail-panel-header h3 { font-size: 15px; margin: 0; }
.detail-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
.detail-body { padding: 16px; }

.detail-summary {
  font-size: 13px; color: #64748b; margin-bottom: 12px;
  padding-bottom: 12px; border-bottom: 1px solid #e2e8f0;
}

.detail-level-section {
  margin-bottom: 8px; border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden;
}
.detail-level-section.has-stock {
  border-color: #bfdbfe;
}
.detail-level-header {
  background: #f1f5f9; padding: 6px 12px; font-size: 12px; font-weight: 600; color: #475569;
}
.detail-level-section.has-stock .detail-level-header {
  background: #dbeafe; color: #1e40af;
}

.detail-item-row {
  padding: 8px 12px; border-top: 1px solid #f1f5f9;
}
.detail-item-name { font-size: 12px; font-weight: 500; color: #1e293b; }
.detail-item-qty { font-size: 12px; color: #2563eb; font-weight: 600; margin-top: 2px; }
.detail-item-lot { font-size: 11px; color: #94a3b8; }
.detail-item-empty { padding: 8px 12px; font-size: 12px; color: #94a3b8; border-top: 1px solid #f1f5f9; }

/* --- 共通 --- */
.map-loading { text-align: center; padding: 40px; color: #94a3b8; font-size: 14px; }
.map-error { text-align: center; padding: 40px; color: #dc2626; font-size: 14px; }
